mumumuの日記: Postfix + SMTP AUTHインストール記録
Fedora Core 3にcourier-imapをインストールし、CRAM-MD5
での認証を行うように設定した。以下にその手順をメモし
ておく。まずはPostfix + SMTP AUTHから。
1 Postfix + cyrus-saslのインストール
----
wget http://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.20.tar.gz
tar xvfz cyrus-sasl-2.1.20.tar.gz
cd cyrus-sasl-2.1.20
./configure; make; su
make install
wget ftp://ramix.jp/mirrors/postfix-release/official/postfix-2.1.5.tar.gz
tar xvfz postfix-2.1.5.tar.gz
make makefiles CCARGS="-DUSE_SASL_AUTH -I/usr/include/sasl" AUXLIBS="-L/usr/lib/sasl2 -lsasl2"
/usr/sbin/useradd postfix
/usr/sbin/groupadd postdrop
mv /usr/sbin/sendmail /usr/sbin/sendmail.OFF
mv /usr/bin/newaliases /usr/bin/newaliases.OFF
mv /usr/bin/mailq /usr/bin/mailq.OFF
make install
cd chroot-setup
chmod +x LINUX2
./LINUX2
----
ここで/etc/postfix/master.cfを編集し、smtpサービス
のinetの行を有効にし、unixドメインソケットのサービス
を無効にする。また、local以外はchrootをyにしておく
そしてmain.cfを編集。最低限の設定の他に、以下の項目は
不正中継対策として非常に重要
mydestination = $myhostname, localhost, $mydomain
# spam blacklist
smtpd_client_restrictions = permit_mynetworks,
reject_rbl_client relays.ordb.org,
reject_rbl_client sbl.spamhaus.org,
permit
# smtp auth authentication
smtpd_sasl_auth_enable = yes
smtpd_sasl_application_name = smtpd
smtpd_sasl_local_domain = hoge.org
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_auth_destination,
reject
----
次にsaslのパスワードを登録し、認証方法を設定する
saslpasswd2 -c -u hoge.org hoge
chmod 444 /etc/sasldb2
cp /etc/sasldb2 /var/spool/postfix/etc
chmod 444 /var/spool/postfix/etc
----
/usr/lib/sasl2/smtpd.confに以下の一行を加える
pwcheck_method: auxprop
----
最後にPostfixを起動し、SMTP AUTHがうまくいくことを確認。
postfix start
Postfix + SMTP AUTHインストール記録 More ログイン