■ 準備
sendmailの停止確認
# sendmailが動作しているか確認 systemctl status sendmail # 停止 systemctl stop sendmail # 自動起動停止 systemctl disable sendmail
■ 手順
【1】Postfixのインストールする
# インストールされているか確認 sudo yum list installed | grep postfix sudo yum install postfix mailx systemctl is-enabled postfix
【2】/etc/postfix/main.cf を編集する
sudo vi /etc/postfix/main.cf ~~~~ myhostname = smtp.sample.com myorigin = $myhostname ~~~~ # 念のために再起動 systemctl restart postfix.serviceパラメータの説明
* myhostname : サーバのホスト名 * mydomain : ドメイン名 * myorigin : ローカルで送信された時のドメイン名($myhostname or $mydomain でいいかと)
【3】/etc/postfix/main.cf を編集する
mail -s "transport test" user@other.sample.com To user@oher.sample.com This is a sample mail. from user@smtp.sample.com . EOF # メールログを確認 sudo cat /var/log/maillog
参考文献
http://server.etutsplus.com/centos-7-configure-postfix-mta/https://www.saintsouth.net/blog/how-to-install-postfix-on-centos7/
http://hikaku-server.com/rentalserver/entry508.html
http://www.uetyi.com/server-const/postfix-setting/entry-460.html
https://serverlog.jp/postfix-smtp-auth/
http://www.aconus.com/~oyaji/centos/smtp-centos.htm
http://www.cross-ring.net/web/DPOW/linux_server_setting/mail/787
http://www.cross-ring.net/web/DPOW/linux_server_setting/mail/863
関連記事
Postfix ~ 入門編 ~
https://blogs.yahoo.co.jp/dk521123/36373100.html== 【AWS】【Linux】EC2内のPostfixでAmazon SESにリレーしてメール送信する==
https://blogs.yahoo.co.jp/dk521123/37383401.html