Postfix + SASL

安裝 /usr/ports/mail/postfix-current

1.
在 postfix-current config 中選擇 TLS 和 SASL(cyrus-sasl)
在 cyrus-sasl config 中選擇 pwcheck (沒需要的話其他的選項都去掉)

2.
安裝過程中選擇 yes
Would you like to activate Postfix in /etc/mail/mailer.conf [n]? yes
3.
將下列加入 /etc/rc.conf 中將原本的 sendmail disable 掉
sendmail_enable="YES"
sendmail_flags="-bd"
sendmail_pidfile="/var/spool/postfix/pid/master.pid"
sendmail_procname="/usr/local/libexec/postfix/master"
sendmail_outbound_enable="NO"
sendmail_submit_enable="NO"
sendmail_msp_queue_enable="NO"

cyrus_pwcheck_enable="yes"
4.
將下列加入 /etc/periodic.conf
daily_clean_hoststat_enable="NO"
daily_status_mail_rejects_enable="NO"
daily_status_include_submit_mailq="NO"
daily_submit_queuerun="NO"
5.
設定 SASL 認證

修改 /etc/group
cyrus:*:60:daemon,postfix
新增/usr/local/lib/sasl/smtpd.conf
pwcheck_method: pwcheck

啟動 cyrus_pwcheck
/usr/local/etc/rc.d/cyrus_pwcheck start

6.
設定 postfix

依照個人需求設定 /usr/local/etc/postfix/main.cf
myhostname = mail.twku.net
mydomain = twku.net
mydestination = mail.twku.net, winfore.com, winnow-intl.com
smtpd_recipient_restrictions = permit_sasl_authenticated, check_relay_domains, permit_mynetworks
smtpd_client_restrictions = permit_sasl_authenticated
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options= noanonymous
smtpd_sasl_local_domain = twku.net
alias_maps = hash:/usr/local/etc/postfix/etc/aliases
virtual_alias_maps = hash:/usr/local/etc/postfix/virtual
message_size_limit = 1024000000
mailbox_size_limit = 2048000000
virtual_mailbox_limit = 2048000000

修改與建立 aliases
postalias /usr/local/etc/postfix/aliases (用來重新導向)

修改與建立 virtual
postmap /usr/local/etc/postfix/virtual (用來產生虛擬的 mail address)

0 Responses to “Postfix + SASL”


  1. No Comments

Leave a Reply