2004年5月2日日曜日

動かなかったPostfix。

Postfixの設定作業を初めて3日目。どうやっても外部からPostfixにアクセスできない。listenコマンドで調べてみると。
tcp4 0 0 127.0.0.1.25 *.* LISTEN

一応ポートは開いているみたいだけどなんだか違うような。。。

どこのページを見ても
tcp4 0 0 *.25 *.* LISTEN

となるのが正しいような気がしてきた。
そんなこんなでpostconf -nで調べてみたら、
inet_interfaces = localhost

となっているではありませんか!!!
よくよくmain.cfを調べてみても
inet_interfaces = all

と、どうみても記述してあるのに。。。
どうなってるんだって、困り果ててネットで検索していたら。
# THE FOLLOWING DEFAULTS ARE SET BY APPLE
#
# bind to localhost only
#
inet_interfaces = localhost
# turn off relaying for local subnet
#
mynetworks_style = host
# mydomain_fallback: optional domain to use if mydomain is not set and
# myhostname is not fully qualified. It is ignored if neither are true.
#
mydomain_fallback = localhost

THE FOLLOWING DEFAULTS ARE SET BY APPLE????
もしや!!!とおもってmain.cfを調べてみたら、
通常の設定のもっともっと下にアップルさんが予め設定した値が書き込んであった。。。
せっかくallって設定してるのに、アップルさんlocalhostってわざわざ上書きしてくれていた。。。
ふぅ。つかれた。やっと解決!
次はsaslを入れてSMTP Authの挑戦です。
それと同時にPostfix関連の書籍を注文しました。
Mac OS X v10.3 メールサーバ構築術
外部からの送受信ができるようになった。
現在は以下のような設定
alias_database = hash:/etc/aliases
alias_maps = netinfo:/aliases, hash:/etc/aliases
biff = no
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
inet_interfaces = all
mail_owner = postfix
mail_spool_directory = /var/mail
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, $mydomain
mydomain = ドメイン名.com
mydomain_fallback = localhost
myhostname = コンピュータ名.ドメイン.com
mynetworks_style = host
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /private/var/spool/postfix
readme_directory = /usr/share/doc/postfix
sample_directory = /usr/share/doc/postfix/examples
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
unknown_local_recipient_reject_code = 450

0 件のコメント: