redhat EnterpriseLinux 6 でPostfixをネットワーク越しに使えるようにする方法 [Linux]
最近、サーバ移行作業を地味に続けています。
今は、redhat4から6へのバージョンアップ。
昔とだいぶ変わったなあと思うのは、標準設定がセキュリティ寄りになっていることです。
一昔前はインストールしたらできるだけすぐに利用できるような標準設定になっていたのですが、変わりましたね。
「設定ファイルをコピーしたらええんや!」という安易な移行は慎まないといけないですね。
というわけで差分をひとつひとつ確認するのも大変なので、ちょっとショートカットしようと思います。
英語のマニュアルにはちゃんと基本設定の変更箇所を整理しています。
By default, Postfix does not accept network connections from any host other than the local host. Perform the following steps as root to enable mail delivery for other hosts on the network:Edit the /etc/postfix/main.cf file with a text editor, such as vi.Uncomment the mydomain line by removing the hash sign (#), and replace domain.tld with the domain the mail server is servicing, such as example.com.Uncomment the myorigin = $mydomain line.Uncomment the myhostname line, and replace host.domain.tld with the hostname for the machine.Uncomment the mydestination = $myhostname, localhost.$mydomain line.Uncomment the mynetworks line, and replace 168.100.189.0/28 with a valid network setting for hosts that can connect to the server.Uncomment the inet_interfaces = all line.Comment the inet_interfaces = localhost line.Restart the postfix service.
デフォルトでは、Postfixはローカル(同一サーバ内)でしかメールが送信できません。通常のメールサーバのようにネットワーク越しに送信するためには以下の設定が必要です。
設定ファイル(/etc/postfix/main.cf)の以下の箇所を編集します。
mydomainを含む行のコメントを外します。(行頭の#を削除)
"domain.tld"を自社のドメインに変更します。例:example.com
myorigin = $mydomain の行のコメントを外します。
myhostnameの行のコメントを外します。
"host.domain.tld" を自社のメールサーバのホスト名にします。例:mail.example.com
mydestination = $myhostname, localhost.$mydomain の行のコメントを外します。
mynetworks の行のコメントを外します。
"168.100.189.0/28"の記述をこのサーバにアクセスできる有効なネットワークアドレスに置き換えます。
inet_interfaces = all の行のコメントを外します。
inet_interfaces = localhost の行をコメントにします。(行頭に#をつける)
postfixを再起動します。
コメント 0