MTA | sendmail | postfix | qmail

Postfix

URL

本家
http://www.postfix.org/
Postfix のページ
http://www.kobitosan.net/postfix/
Postfxi-JP Mailing List
http://www.kobitosan.net/postfix/ML/
Postfix のインストール(國頭さん)
http://www.hal.t.u-tokyo.ac.jp/~kunito/install/postfix/
第三者中継確認
http://www.nanet.co.jp/rlytest/relaytest.html
harry.ki.nu

    <<< 220 harry.ki.nu ESMTP Postfix (Postfix-19991231-pl08)
    >>> HELO rlytest.nanet.co.jp
    <<< 250 harry.ki.nu
    >>> MAIL FROM:<"45ec83:TPR TEST http://www.nanet.co.jp/rlytest/ requested from [210.145.xx.yyy]"@harry.ki.nu>
    <<< 250 Ok
    >>> RCPT TO:
    <<< 554 : Recipient address rejected: Relay access denied

正常:中継は拒否されました

設定等

/etc/postfix/
ここに設定する。 まずは
README main.cf master.cf postfix-script
だけがある。この main.cf などの設定を起動後に 変更した場合は postfix reload とする。

/etc/postfix/main.cf での設定例
変数名設定内容例 (実際は一行に書きます)説明
必須
mydomainmy.domaindomain 名を設定
多分必須
mydestination $myhostname, localhost.$mydomain, othername.$mydomain 自分の名前以外にも別名(DNS で CNAME などの設定があるもの)などで受取る必要のあるものを列挙
alias_mapshash:/etc/mail/aliases メール受取の別名(alias)を設定
SPAM 関係
mynetworks192.168.0.0/16自分のネットワークアドレス/有効ビット数
relay_domains$mydestination 中継をするドメインを指定します。この例は別に定義した変数を参照しています。
smtpd_client_restrictions (*1)reject_maps_rbl maps_rbl を見て登録されているところは相手をしません
maps_rbl_domainsinputs.orbz.org 実際の登録データべースを指定
メーリング・リスト
allow_mail_to_commandsalias, forward, include /etc/mail/aliases で :include: 等が使えるようにします
場合によって
recipient_delimiter+ user+anystring@hostname.domain としても user@hostname.domain に届くように設定
smtp_banner$myhostname ESTMP $mail_name($mail_version) telnet hostname smtp などとした時の応容文字列を設定
(*1) /usr/share/examples/postfix/sample-smtpd.cf も見て下さい。 smtpd_recipient_restrictions の設定方法を間違えると、却って問題が起きることもあります ので、分らない時には何も設定しない方がいいです。

/usr/share/examples/postfix/
設定例がいくつもあるので参考にする
/var/spool/postfix/
こちらが作業用
起動
起動するには postfix start と入力する
/etc/rc.conf に設定するには
postfix=YES
と書いておけば良い

誤り等

not a fully qualified name
postfix: fatal: My hostname harry is not a fully qualified name - set myhostname or mydomain in /etc/postfix/main.cf
まず postfix start とすると、いきなり上記のように 言われる。 gethostname() が正しく FQDN を取得しないのが原因という気がするが、例えば sendmail の方だと、 何も問題がないので、そういう単純な問題でもなさそう。
/etc/postfix/main.cf に $myhostname か $mydomain を設定する。
pid/master.pid
Dec  1 07:55:29 harry postfix-script: starting the Postfix mail system
Dec  1 07:55:29 harry postfix/master[361]: fatal: error opening file pid/master.pid: No such file or directory
と言われるが
touch /var/spool/postfix/pid/master.pid
しておく必要がある 2001/11/30
to=<user@domain>, relay=local, delay=1, status=deferred (temporary failure)
という問題が出て、何か分らなかった。/etc/postfix/master.cf の中の local の行の最後に -v -v を加えたら、 /var/log/maillog に やたら詳しい情報が表示されて ~/.forward の
"|IFS=' ' && p=/usr/bin/procmail && test -f $p && exec $p -Yf- || exit 75 #fujiwara"
という procmail の記述が間違っているというよりも /usr/bin/procmail 自体が無かった ということで、~/.forward を別の名前に変えておいたら、 やっと受信してくれるようになった。
procmail を local delivery に使うには ?
http://www.postfix.org/faq.html#procmail
Last Update
19:53:34 03/12/08
claudebot
Apache/2.0.65 (Unix) mod_ssl/2.0.65 OpenSSL/1.0.1g DAV/2 PHP/5.4.26
Count.cgi
(since 2001/12/01)