Code of the O....rz....hov
2026
2025
2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011
2010
2009
2008
2007
1月
2月
3月
4月
5月
6月
7月
8月
9月
10月
11月
12月
全1件 (1件中 1-1件目)
1
http://hisashim.livejournal.com/333206.html[Memo][SysAdmin][Mail] Postfix SMTP-AUTH with saslauthd + pamDebian etch上のPostfixでSMTP-AUTHを行い、SASL認証できたクライアントにのみ他ドメインへのリレーを許可する設定。 SASL認証にはsaslauthd + pamを使う。SSL/TLSによる通信路の暗号化は後で。必要なものをインストール。最近はpostfixでtlsとsaslが使えるようになったので、postfix-tlsでなくてよい。あとsaslauthdを使うならlibsasl2-modulesのインストールを忘れずに。fatal: no SASL authentication mechanismsと言われる。% sudo apt-get install postfix postfix-doc sasl2-bin libsasl2-modulessaslauthdのREADMEにPostfixから使う際の例が書いてあるので、よく読んで設定。起動を忘れずに。% sudo vi /etc/default/saslauthd START=yesOPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"% sudo dpkg-statoverride --add root sasl 710 /var/spool/postfix/var/run/saslauthd % sudo adduser postfix sasl Adding user `postfix' to group `sasl' ...Done.% sudo /etc/init.d/saslauthd startStarting SASL Authentication Daemon: saslauthd.PostfixのサーバとしてのSASL設定ファイルを作る。pwcheck_methodとmech_listの両方を指定すること。% sudo >/etc/postfix/sasl/smtpd.conf % sudo vi /etc/postfix/sasl/smtpd.conf pwcheck_method: saslauthdmech_list: plain loginPostfixのmain.cfにSASLの設定を追加してリロード。注意点: * 設定ファイルのデリミタは空白のみが安全らしい。カンマは避ける。 * Postfixがクライアントとして動作するときの挙動はsmtp_*で、サーバとして動作するときの挙動はsmtpd_*で制御する。 * PostfixのSASL_README.htmlにあるsmtpd_recipient_restrictionsの設定例の右辺は = permit_mynetworks permit_sasl_authenticatedとなっているが、拒否を意味する値を1つは含めないとエラーを吐いて動かない模様。 ただしrejectだと554 5.7.1 johnd@example.org: Recipient address rejected: Access denied; となってまともなユーザまでメールを受け取れなくなるので、reject_unauth_destinationに。% sudo vi /etc/postfix/main.cf smtpd_sasl_auth_enable = yessmtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination% sudo postconf -n% sudo /etc/init.d/postfix reload% telnet localhost smtpTrying 127.0.0.1...Connected to localhost.Escape character is '^]'.220 example.org ESMTP PostfixEHLO foo250-example.org...250-AUTH PLAIN LOGIN...% sudo tail /var/log/mail.logThunderbirdで試してみるときはログを取るとよい。 notepad C:\Program Files\Mozilla Thunderbird\thunderbird-log.batset NSPR_LOG_FILE=.\log.txtset NSPR_LOG_MODULES=IMAP:5,POP3:5,NNTP:5,SMTP:5"C:\Program Files\Mozilla Thunderbird\thunderbird.exe"sshで中継するときも-vで冗長にメッセージを出してもらうとよい。% slogin -v -L 993:example.org:993 -L 25:example.org:25 jdoe@example.org 資料: * /usr/share/doc/postfix/README.Debian * /usr/share/doc/sasl2-bin/README.Debian * http://www.postfix-jp.info/trans-2.3/jhtml/SASL_README.html * http://www.postfix-jp.info/trans-2.3/jhtml/SMTPD_ACCESS_README.html * http://www.postfix-jp.info/origdocs/install-report-sasl.html * http://www.araki.net/wiki/araki-wiliki.cgi?araki%3apostfix%3apostfix-book-errata1 * http://hurring.com/howto/debian_postfix_sasl/ If you get the "fatal: no SASL authentication mechanisms" error message from postfix, install "libsasl2-modules" * http://www.mozilla.org/quality/mailnews/mail-troubleshoot.html#imap
Sep 3, 2008