2014-09-06 01:28:34
来 源
中存储网
Postfix
Debian系统中Postfix安装sasl的方法参考:1。OReilly - Postfix The Definitive Guide2。http://wiki.debian.org.tw/index.php/Postfix-SASL3。http://www.postfix.org/SASL_README.html

(使用pwcheck_method: auxprop,即不是使用系统/etc/passwd中的帐号密码)

参考:
1。OReilly - Postfix The Definitive Guide
2。http://wiki.debian.org.tw/index.php/Postfix-SASL
3。http://www.postfix.org/SASL_README.html

1。安装好postfix系统(略)
2。apt-get install postfix-tls sasl2-bin libsasl2-modules
3。mkdir -p /etc/postfix/sasl
4。echo "pwcheck_method: auxprop" > /etc/postfix/sasl/smtpd.conf
5。在/etc/postfix/mail.cf中加入
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_security_options = noanonymous
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks,

check_relay_domains, reject_unauth_destination
smtpd_client_restrictions = permit_sasl_authenticated

6。修改/etc/postfix/master.cf(也就是说 Postfix 不要以 chroot 樱
把smtp inet n - - - - smtpd
改为:
smtp inet n - n - - smtpd

7。chown postfix:sasl /etc/sasldb2
8。chmod 440 /etc/sasldb2
9。saslpasswd2 -c -u `postconf -h myhostname` test(建立一个帐号test)
(使用该命令后,会提示你输入这个帐号的密码,有点象linux的添加用户命令adduser)
10。/etc/init.d/postfix restart

然后就可以在 foxmail 中用这个帐号测试

提示:

1。saslpasswd2 建立的帐号可以使用sasldblistusers2 查看
saslpasswd2 -c -u 创建用户的时候,要指定一个后缀
如果saslpasswd2 -c -u `postconf -h myhostname` test 创建的test 在foxmail中的帐号可以只写test

但是
如果saslpasswd2 -c -u xxxxx.com test的话
那么foxmial中的帐号就要写全为test@xxxxx.com

如果saslpasswd2 -c test

你可以是使用sasldblistusers2 查看一下这个帐号的后缀是什么
记得在foxmail中的帐号要写全称

2。如果想postfix 只使用一种认证机制,可以在/etc/postfix/sasl/smtpd.conf中修改

例如:我想postfix只支持2中认证plain login
可以在/etc/postfix/sasl/smtpd.conf文件中加入
mech_list: plain login

声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。