設置postfix支持smtp認證

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認證了
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章