次は外部にメール送信 †LAN内(サーバマシン内)でのメール送信はできました。 ためしに外部へメールを送ってみます。 # mail xxx@gmail.com とした時のメールログ(/var/log/maillog)はこんな感じです。 Feb 11 04:29:41 longearth postfix/qmgr[5811]: 849784901F2: from=<root@longearth.dip.jp>, size=304, nrcpt=1 (queue active) Feb 11 04:30:11 longearth postfix/smtp[6016]: connect to gmail-smtp-in.l.google.com[209.85.201.114]: Connection timed out (port 25) Feb 11 04:30:41 longearth postfix/smtp[6016]: connect to gmail-smtp-in.l.google.com[209.85.201.27]: Connection timed out (port 25) Feb 11 04:31:11 longearth postfix/smtp[6016]: connect to alt1.gmail-smtp-in.l.google.com[209.85.133.114]: Connection timed out (port 25) Feb 11 04:31:41 longearth postfix/smtp[6016]: connect to alt2.gmail-smtp-in.l.google.com[209.85.135.114]: Connection timed out (port 25) Feb 11 04:32:11 longearth postfix/smtp[6016]: connect to alt1.gmail-smtp-in.l.google.com[209.85.133.27]: Connection timed out (port 25) Feb 11 04:32:11 longearth postfix/smtp[6016]: 849784901F2: to=<longearth@gmail.com>, relay=none, delay=150, delays=0.03/0/150/0, dsn=4.4.1, status=deferred (connect to alt1.gmail-smtp-in.l.google.com[209.85.133.27]: Connection timed out) 接続がタイムアウトしてしまいます。 これはgmailのsmtpサーバがどこの誰だかわからないメールサーバからの送信を拒否しているからです。 プロバイダのメールサーバを経由してメールを送信する †プロバイダのメールサーバが25番ポートを relayhost = [smtp.xxx.xxx]:25 これで上記のsmpt.xxx.xxxサーバの25番ポートへ接続しに行くようになります。(ポート番号は省略可) それでも送信できない場合 †yahooBBでは、25番ポートを指定してメールが送れないようです。 OP25B対策で必要な作業は以下になります。
OP25B対策のpostfix設定 †この場合、サブミッションポートと呼ばれる代替ポートを使用することで回避できます。 relayhost = [smtp.xxx.xxx]:587 プロバイダのメールサーバの認証方法を確認 †# telnet smtp.nifty.com 587 Trying 202.248.238.12... Connected to smtp.nifty.com. Escape character is '^]'. 220 msag500.nifty.com ESMTP Nifty Mail Server ehlo localhost 250-msag500.nifty.com Hello nttkyo465051.tkyo.nt.ftth.ppp.infoweb.ne.jp [124.25.195.51], pleased to meet you 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-8BITMIME 250-SIZE 20971520 250-DSN 250-AUTH=PLAIN LOGIN CRAM-MD5 250-AUTH PLAIN LOGIN CRAM-MD5 250-DELIVERBY 250 HELP AUTH=PLAIN LOGIN ~CRAM-MD5とあるので、 SASLの導入 †postfixにSASLを導入してメール送信時に認証を通すように設定します。 |