1. 安装组件
yum install -y postfix dovecot saslauthd*
yum install -y postfix dovecot saslauthd*
#如果已经安装则不必执行这一步
2. 运行
saslauthd -v
saslauthd -v
#如果显示类似authentication mechanisms:getpwent pam shadow则可显示saslauthd支持的认证机制
3. 编辑/etc/sysconfig/saslauthd文件,确认其为
MECH=pam
MECH=pam
4. 启动saslauthd
service saslauthd start
service saslauthd start
运行:
/usr/sbin/testsaslauthd –u user –p ‘password’
/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
telnet 127.0.0.1 25
输入:
ehlo 163.com
如果在返回的列表中有:
250-AUTH GSSAPI NTLM LOGIN PLAIN
250-AUTH=GSSAPI NTLM LOGIN PLAIN
两行,则表明postfix已经启用smtp认证了
转载于:https://blog.51cto.com/sa2004/457353