作業系統: Debian 3.1 / 4 均實測過
[全部安裝套件]---------------
postfix , libsasl2 , libsasl2-modules , sasl2-bin
dovecot-common , dovecot-imapd , dovecot-pop3d
其中 postfix 用來寄信 ,
sasl 用來驗證是否幫 user 做mail relay
dovecot 用來收信 (支援 pop3,imap)
[修改 /etc/postfix/main.cf]---------------
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_client_restrictions = permit_sasl_authenticated
smtpd_sasl_security_options = noanonymous
smtpd_recipient_restrictions = permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination
[ /etc/postfix/master.cf 中 ]---------------
將 smtp 的 chroot功能取消
[ 建立 /etc/postfix/sasl/smtpd.conf ]---------------
log_level: 3
pwcheck_method: saslauthd
mech_list: PLAIN LOGIN
[ 更改 /etc/default/saslauthd ]---------------
START = yes
MECHANISMS = shadow
[更改 pop3 設定檔 /etc/dovecot/dovecot.conf ]---------------
protocols = imap pop3
listen = *
disable_plaintext_auth = no
[ 更改 /var/run/saslauthd 目錄權根 ]---------------
chmod 755 saslauthd
[ 重新啟動服務 ]---------------
sudo /etc/init.d/saslauthd restart
sudo /etc/init.d/dovecot restart
sudo /etc/init.d/saslauthd