2014年9月29日月曜日

postfix メモ

■動いてるかもしれないデフォルトのsendmailを止める
/etc/rc.d/init.d/sendmail stop

■postfixインストール
yum -y install postfix

■postfix起動
[root@dti-vps-srv741 trunk]# service postfix restart
Shutting down postfix:                                     [FAILED]
Starting postfix:                                          [  OK  ]

■MTA変更前の設定確認
[root@dti-vps-srv741 trunk]# alternatives --display mta
mta - status is manual.
 link currently points to /usr/sbin/sendmail.sendmail    ←デフォルトはsendmail  

■MTAの切り替え
[root@xxxxx trunk]# alternatives --config mta

There are 2 programs which provide 'mta'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/sbin/sendmail.sendmail                      ・・・デフォルトはsendmailになってる
   2           /usr/sbin/sendmail.postfix

Enter to keep the current selection[+], or type selection number: 2  ・・postfixは2なので2を入力しエンター

■MTA変更後の設定確認
[root@xxxxx trunk]# alternatives --display mta
mta - status is manual.
 link currently points to /usr/sbin/sendmail.postfix    ←postfixになったことを確認

■メール送信テスト
[[root@xxxxx trunk]# /usr/sbin/sendmail -f <送信元メアド> <送信先メアド> <<EOM
From: <送信元メアド>
To: <送信先メアド>
Subject:テストです
Content-Type:text/plain;charset=UTF-8;
テストでメールを送ってみました。

EOM


送信先メアドで上記の送信テストのメールを受信できたかを確認


0 件のコメント:

コメントを投稿