版本 redhat 6.2 cyrus-sasl-1.5.24 snapshot-20010329
步骤: 1.安装sasl #./configure --enable-login --with-pwcheck;make;make install #echo /usr/local/lib>>/etc/ld.so.conf #echo /usr/local/lib/sasl >> /etc/ld.so.conf # ldconfig 2.安装postfix # make tidy # make makefiles CCARGS="-DUSE_SASL_AUTH -I/usr/local/include" \ AUXLIBS="-L/usr/local/lib -lsasl" # make # adduser -s /bin/false postfix # make install 3.修改postfix的cf文件使支持smtp认证 在/etc/postfix/main.cf文件最后加上: smtpd_sasl_auth_enable = yes smtpd_delay_reject=yes smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated permit_auth_destination reject smtpd_client_restrictions = permit_sasl_authenticated broken_sasl_auth_clients = yes smtpd_sasl_security_options = noanonymous 就支持smtp认证了。其余的配置请参考/etc/postfix/main.cf.default和sample-*文件,这里不多说。 现在telnet 25口应该有下面的提示 telnet 127.0.0.1 25 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. 220 mailx.bjcnuol.com ESMTP Postfix ehlo 127.0.0.1 250-mailx.bjcnuol.com 250-PIPELINING 250-SIZE 10240000 250-ETRN 250-AUTH LOGIN PLAIN 250-AUTH=LOGIN PLAIN 如果有就差不多成功了。
3.配置sasl使支持smtp认证 # touch /usr/local/lib/sasl/smtpd.conf # echo pwcheck_method:shadow >> /usr/local/lib/sasl/smtpd.conf
4.因为postfix用户无权读取/etc/shadow所以必须把shadow文件的权限改成postfix,这不能不说是一个缺陷,如果你觉得不安全,你可以将认证方式该为sasldb的方式,但是这样需要额外创建用户和口令不能和邮件用户的口令保持一致修改口令也不方便。此外还可以用pwcheck守护进程,但我没试出来感兴趣的朋友可以试试,如果成功了别忘了告诉我。
5配置OE5 1.打开你的Outlook Express,修改你的账号属性,在服务器选项,选取我的smtp服务器需要认证选项, 然后进入配置。
2.不要选取安全口令认证,sendmail并不支持这个选项。是选取使用pop3同样的口令还是选择另外输入用户密码,这就看你的爱好和设置了,这不是关键。如果你在服务器上有一个真实账号,不妨选取使用同样的口令,如果没有账号,选用其他的用户口令同样可以。
6 启动和关闭postfix 启动 postfix start 关闭 postfix stop 你可以把postfix start放到/etc/rc.d/rc.local文件的最后用来每次重起后自动启动postfix
|