<a>1、安装Courier-Authlib</a>
安装以下软件包:
shell
# yum install courier-authlib
# yum install courier-authlib-mysql
编辑/etc/authlib/authmysqlrc文件:
# vi /etc/authlib/authmysqlrc
并将其内容清空,然后增加如下内容:
MYSQL_SERVER localhost MYSQL_USERNAME extmailMYSQL_PASSWORD extmail MYSQL_SOCKET /var/lib/mysql/mysql.sockMYSQL_PORT 3306 MYSQL_OPT 0MYSQL_DATABASE extmail MYSQL_USER_TABLE mailboxMYSQL_CRYPT_PWFIELD password MYSQL_UID_FIELD uidnumberMYSQL_GID_FIELD gidnumber MYSQL_LOGIN_FIELD usernameMYSQL_HOME_FIELD homedir MYSQL_NAME_FIELD nameMYSQL_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文件
# vi /etc/authlib/authdaemonrc
修改如下内容:
authmodulelist="authmysql" authmodulelistorig="authmysql"
<a>2、启动courier-authlib:</a>
# service courier-authlib start
如一切正常,命令行将返回如下信息:
Starting Courier authentication services: authdaemond
修改authdaemon socket目录权限
如果该目录权限不正确修改,maildrop及postfix等将无法正确获取用户的信息及密码认证:
# chmod 755 /var/spool/authdaemon/
本文转自glying 51CTO博客,原文链接:http://blog.51cto.com/liying/968571,如需转载请自行联系原作者