Sendmailでサブミッションポート(587番ポート)を使用する設定方法です。サブミッションポートを使用するには、cyrus-sasl syrus-sasl-md5が必要になります。インストールしていない場合、下記を参考にインストールしてください。
・cyrus-sasl syrus-sasl-md5のインストール
[root@localhost ~]# yum install cyrus-sasl syrus-sasl-md5
・ポートの確認
サブミッションポートの使用状況の確認をします。確認には、telnetコマンドを使います。
587ポートを使っていない場合
[root@localhost ~]# telnet localhost 587
Trying 127.0.0.1…
telnet: connect to address 127.0.0.1: Connection refused
sendmailで587ポートを使っている場合
[root@localhost ~]# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
/etc/mail/sendmail.mc:10: m4: cannot open `/usr/share/sendmail-cf/m4/cf.m4′: No such file or directory
・設定ファイルの変更
sendmail.mcファイルの編集をします。
[root@localhost ~]# vi /etc/mail/sendmail.mc
・設定の反映と再起動
「sendmail」の設定を反映させます。「m4」コマンドでエラーが出る場合は下記を参考にしてください。
[root@localhost ~]# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
「saslauthd」を起動します。
[root@web ~]# service saslauthd start
「sendmail」の再起動
[root@localhost ~]# /etc/init.d/sendmail restart
・OS起動時に「saslauthd」を自動起動する
[root@localhost ~]# chkconfig –list saslauthd
saslauthd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@localhost ~]# chkconfig saslauthd on
[root@localhost ~]# chkconfig –list saslauthd
saslauthd 0:off 1:off 2:on 3:on 4:on 5:on 6:of
(ちょっと失敗・・)
「m4」コマンドを実行したときに下記のエラーがでました。「m4」コマンドを実行するには「sendmail-cf」「sendmail-devel」が必要になります。「sendmail-cf」「sendmail-devel」は、yumでインストールして対処しました。
・エラーの内容
/etc/mail/sendmail.mc:10: m4: cannot open `/usr/share/sendmail-cf/m4/cf.m4′: No such file or directory
・対処方法
[root@localhost ~]# yum install sendmail-cf
[root@localhost ~]# yum install sendmail-devel