1、安装Courier-Authlib
安装以下软件包:
shell
# yum install courier-authlib
# yum install courier-authlib-mysql
编辑/etc/authlib/authmysqlrc文件:
shell
# vi /etc/authlib/authmysqlrc
并将其内容清空,然后增加如下内容:
-
MYSQL_SERVER localhost
-
MYSQL_USERNAME extmail
-
MYSQL_PASSWORD extmail
-
MYSQL_SOCKET /var/lib/mysql/mysql.sock
-
MYSQL_PORT 3306
-
MYSQL_OPT 0
-
MYSQL_DATABASE extmail
-
MYSQL_USER_TABLE mailbox
-
MYSQL_CRYPT_PWFIELD password
-
MYSQL_UID_FIELD uidnumber
-
MYSQL_GID_FIELD gidnumber
-
MYSQL_LOGIN_FIELD username
-
MYSQL_HOME_FIELD homedir
-
MYSQL_NAME_FIELD name
-
MYSQL_MAILDIR_FIELD maildir
-
MYSQL_QUOTA_FIELD quota
-
MYSQL_SELECT_CLAUSE SELECT username,password,"",uidnumber,gidnumber,\
-
CONCAT('/home/domains/',homedir), \
-
CONCAT('/home/domains/',maildir), \
-
quota, \
-
name \
-
FROM mailbox \
-
WHERE username = '$(local_part)@$(domain)'
修改authdaemonrc文件
shell
# vi /etc/authlib/authdaemonrc
修改如下内容:
-
authmodulelist="authmysql"
-
authmodulelistorig="authmysql"
-
authmodulelist="authmysql"
-
authmodulelistorig="authmysql"
2、启动courier-authlib:
shell
# service courier-authlib start
如一切正常,命令行将返回如下信息:
Starting Courier authentication services: authdaemond
修改authdaemon socket目录权限
如果该目录权限不正确修改,maildrop及postfix等将无法正确获取用户的信息及密码认证:
shell
# chmod 755 /var/spool/authdaemon/
阅读(879) | 评论(0) | 转发(0) |