您的位置:首页 > 编程语言 > PHP开发

设置postfix支持smtp认证

2010-12-16 13:34 405 查看
1. 安装组件
yum install -y postfix dovecot saslauthd*
#如果已经安装则不必执行这一步

2. 运行
saslauthd -v
#如果显示类似authentication mechanisms:getpwent pam shadow则可显示saslauthd支持的认证机制

3. 编辑/etc/sysconfig/saslauthd文件,确认其为
MECH=pam

4. 启动saslauthd
service saslauthd start
运行:
/usr/sbin/testsaslauthd –u user –p ‘password’
#测试saslauthd认证功能是否起作用了

5. 设置postfix支持smtp认证
在main.cf文件中更改如下:

smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = ''
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
broken_sasl_auth_clients=yes
smtpd_client_restrictions = permit_sasl_authenticated
smtpd_sasl_security_options = noanonymous

6. 编辑/usr/lib/sasl2/smtpd.conf文件,确认其为:
pwcheck_method: saslauthd

7. 启动postfix
service postfix start

8. 测试smtp认证
telnet 127.0.0.1 25
输入:
ehlo 163.com
如果在返回的列表中有:
250-AUTH GSSAPI NTLM LOGIN PLAIN
250-AUTH=GSSAPI NTLM LOGIN PLAIN
两行,则表明postfix已经启用smtp认证了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: