构建反病毒反垃圾邮件系统(三)
来源:云南设计港 时间:2007-09-27 13:43:00
mysql-virtual.cf
user=mysql-postfix-user
password=mysql-postfix-pass
dbname=postfix
table=virtual
select_field=destination
where_field=email
hosts=127.0.0.1
mysql-virtual-maps.cf
user=mysql-postfix-user
password=mysql-postfix-pass
dbname=postfix
table=users
select_field=maildir
where_field=email
additional_conditions=andpostfix='y'
hosts=127.0.0.1
mysql-virtual-uid.cf
user=mysql-postfix-user
password=mysql-postfix-pass
dbname=postfix
table=users
select_field=uid
where_field=email
additional_conditions=andpostfix='y'
hosts=127.0.0.1
mysql-virtual-gid.cf
user=mysql-postfix-user
password=mysql-postfix-pass
dbname=postfix
table=users
select_field=gid
where_field=email
additional_conditions=andpostfix='y'
hosts=127.0.0.1
修改Courier相关设置,/etc/courier/imapd:
AUTHMODULES="authdaemon"
IMAP_CAPABILITY="IMAP4rev1CHILDRENNAMESPACETHREAD=ORDEREDSUBJECT
THREAD=REFERENCESSORTAUTH=CRAM-MD5AUTH=CRAM-SHA1IDLE"
修改/etc/courier/pop3d
AUTHMODULES="authdaemon"
POP3AUTH="LOGINCRAM-MD5CRAM-SHA1"
修改/etc/courier/authdaemonrc
authmodulelist="authmysqlauthpam"
使用mysql验证和pam验证。
修改/etc/courier/authmysqlrc
MYSQL_SERVER127.0.0.1
MYSQL_USERNAMEmysql-postfix-user
MYSQL_PASSWORDmysql-postfix-pass
#MYSQL_SOCKET/var/run/mysql/mysql.sock
MYSQL_PORT0
MYSQL_OPT0
MYSQL_DATABASEpostfix
MYSQL_USER_TABLEusers
MYSQL_LOGIN_FIELDemail
MYSQL_CLEAR_PWFIELDclear
MYSQL_UID_FIELDuid
MYSQL_GID_FIELDgid
MYSQL_HOME_FIELDhomedir
MYSQL_MAILDIR_FIELDmaildir
SASLlibrary
创建/etc/postfix/sasl/smtpd.conf:
pwcheck_method:PAM
PAM-MySQL
创建/etc/pam.d/smtp:
authoptionalpam_mysql.sohost=localhostdb=postfixuser=
mysql-postfix-userpasswd=mysql-postfix-passtable=users
usercolumn=emailpasswdcolumn=clearcrypt=n
accountrequiredpam_mysql.sohost=localhostdb=postfixuser=mysql-postfix-userpasswd=mysql-postfix-passusercolumn=emailpasswdcolumn=clearcrypt=n