Do You PHP はてブロ

Do You PHPはてなからはてブロに移動しました

Postfix2.2+cyrus-saslのver.1でSMTP-AUTH

何度かやってるはずなのに、久しぶりにやると手順を全然覚えてなかったのでメモ。
Postfixとcyrus-saslのインストールと、Postfixの基本的な設定手順は割愛ということで。。。;-)
しかし、いまさらver.1を触ることになるとは。。。

# pwd
/etc/postfix
# vi /usr/lib/sasl/smtpd.conf
# cat /usr/lib/sasl/smtpd.conf
pwcheck_method:sasldb
#
# saslpasswd -c -u example.com shimooka
Password:
Again (for verification):
# ll /etc/sasldb
-rw-------    1 root     root         3385 Dec  1 10:57 /etc/sasldb
# chgrp postfix /etc/sasldb
# chmod 640 /etc/sasldb
#
# vi main.cf
# tail -n 3 main.cf
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_relay_domains
broken_sasl_auth_clients = yes
#
# service postfix reload
postfix/postfix-script: refreshing the Postfix mail system
telnet localhost smtp
# telnet localhost smtp
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 example.com ESMTP Postfix
EHLO example.com
250-example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH PLAIN LOGIN DIGEST-MD5 CRAM-MD5
250-AUTH=PLAIN LOGIN DIGEST-MD5 CRAM-MD5
250 8BITMIME
quit
221 Bye
Connection closed by foreign host.
#