debian 给postfix安装sasl的方法

http://tech.ddvip.com   2007年03月13日    社区交流

本文详细介绍debian 给postfix安装sasl的方法

  (使用pwcheck_method: auxprop,即不是使用系统/etc/passwd中的帐号密码)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_authenticated6。修改/etc/postfix/master.cf(也就是说讓 Postfix 不要以 chroot 啟動)

  把smtp   inet n    -    -    -    -    smtpd

  改为:

  smtp   inet n    -    n    -    -    smtpd7。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

来源:cublog    作者:sosogh    责编:豆豆技术应用

正在加载评论...