MTAをpostfixに変更する

Linux

MTAはメール転送エージェント(Mail Transfer Agent)です。
VPSなどの場合に、デフォルトでsendmailが設定されている場合がありますのでpostfixを使う場合にはMTAを変更する必要があります。

 

まずは、現在のMTAが何になっているかを確認してみます。
[shell]
alternatives –display mta
[/shell]

 

実行結果として下記の様に表示された場合は、sendmailが利用されています。
[shell]
mta – status is auto.
link currently points to /usr/sbin/sendmail.sendmail

[/shell]

 

既にpostfxになっている場合は下記の様になります。
[shell]
mta – status is auto.
link currently points to /usr/sbin/sendmail.postfix

[/shell]

 

では、sendmailがMTAになっている場合の切換えを行うために下記のコマンドを実行します。
[shell]
alternatives –config mta
[/shell]

 

実行すると対話式なメッセージが出力されます。
[shell]
There is 1 program that provides ‘mta’.

Selection Command
———————————————–
*+ 1 /usr/sbin/sendmail.sendmail
* 2 /usr/sbin/sendmail.postfix

Enter to keep the current selection[+], or type selection number:
[/shell]

 

番号を入力と出ているので、”/usr/sbin/sendmail.postfix”となっている”Selection”の”2″を入力します。

 

入力後にMTAが切り替わっている事を、先ほどのコマンドで確認します。
[shell]
alternatives –display mta
[/shell]

 

MTAを切り替えた後、sendmailが起動したままの場合がありますので停止しておきます。
[shell]
/etc/init.d/sendmail stop
[/shell]

 

また、OSの起動時にsendmailが立ち上がらない + postfixが起動する様に下記のコマンドを実行します。
[shell]
# sendmailの自動起動を停止
chkconfig sendmail off

# postfixの自動起動の設定
chkconfig postfix on
[/shell]

 

最後に、設定が出来たことを確認しておきます。
[shell]
chkconfig –list |grep 3:on
[/shell]

 

表示された中にpostfixが存在し、sendmailが無い事を確認できれば設定完了です。

コメント

タイトルとURLをコピーしました