設定の記録メモ(色々いじったあたのメモだけに別の機会に書き直す必要がありそう。。)
Dovecot
postfix
SASL (cyrus-sasl)
は、すべて yum からinstall
SMTP-AUTHを、dovecot連携で利用する場合は、
修正するファイルは
/etc/postfix/main.cf
/etc/dovecot.conf
SMTP-AUTHを、cyrusで利用する場合は、
/etc/postfix/main.cf
/usr/lib/sasl/smtpd.conf
あたりになる。
ちなみに、 cyrus-sasl-sql を入れていると
postfix/smtpd[28060]: auxpropfunc error invalid parameter supplied
postfix/smtpd[28060]: sql_select option missing
postfix/smtpd[28060]: auxpropfunc error no mechanism available
あたりのログを /var/log/message にはかれる場合がある、その場合はアンインストールすればいいです。(もちろんつかってなければ)
Cyrus-saslと連携する場合は
Postfix SASL Howto
http://www.postfix-jp.info/trans-2.1/jhtml/SASL_README.html
で確認してもらうのがよさげ、その場合の main.cfの設定は
# for Cyrus-SASL
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = cyrus
smtpd_sasl_path = smtpd
smtpd_sasl_local_domain = $myhostname,$mydomain
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
あたりになります。
smtpd_recipient_restrictionsのところで、
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_relay_domains, reject
となっているサイトは、postfixが1系だと思うので、2系(2.1系だったかな?)の場合は、check_relay_domains, rejectのかわりに reject_unauth_destination を記載してあげる。
平文の認証を禁止する場合は
smtpd_sasl_security_options = noanonymous
でなく
smtpd_sasl_security_options = noanonymous,noplaintext
とする。
Dovecotと連携する場合は、main.cfに
# fordovecot
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain = $myhostname,$mydomain
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
と記載、上記との変更点はsmtpd_sasl_type = dovecot smtpd_sasl_path = private/auth の部分
で、/etc/dovecot.conf に
auth default {} で囲まれている一番下の方に
socket listen {
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}
}
を記載
その他環境によっては
#protocols = imap imaps pop3 pop3s
auth default {} の mechanisms = -> 利用する認証の種類
などは変更しておく。
あとは、inid.d からリスタートさせればOK。上手くいかない場合は
[root@xxx postfix]# postconf -A
cyrus
[root@xxx postfix]# postconf -a
cyrus
dovecot
を確認したり
[root@xxx postfix]# telnet localhost 25
Trying 127.0.0.1…
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]’.
220 www.example.com ESMTP Postfix
EHLO localhost
250-www.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH PLAIN
250-AUTH=PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
quit
221 2.
とかで、250-AUTH がでるか確認。
http://www.aconus.com/~oyaji/mail2/smtp-auth-tst.htm
あたりを参考にしてください。