メール配信遅延をデバッグする方法は?

メール配信遅延をデバッグする方法は?

サーバーで何が起こっているのかを知らせるには、単純なmailutilsコマンドを使用して次@hourlyを実行しますcron

cat $file | mail -s "Subject" $receivers

その中には$receiversいくつかのメールアドレスのリストがあります。時にはこのソリューションは非常にスムーズに動作しますが、ほとんどの場合、すべての電子メールアドレスへの転送は特定の時間(約30分)遅れます。この遅延時間は常に同じです。

/var/log/mail.log次のメッセージが表示されます。

Mar 19 05:00:17 myserver postfix/smtp[21138]: connect to gmail-smtp-in.l.google.com[2a00:1450:400b:c02::1b]:25: Network is unreachable
Mar 19 05:00:47 myserver postfix/smtp[21137]: connect to mail.global.sprint.com[207.46.163.247]:25: Connection timed out
Mar 19 05:00:47 myserver postfix/smtp[21138]: connect to gmail-smtp-in.l.google.com[74.125.24.27]:25: Connection timed out
Mar 19 05:01:17 myserver postfix/smtp[21137]: connect to mail.global.sprint.com[207.46.163.170]:25: Connection timed out
Mar 19 05:01:18 myserver postfix/smtp[21138]: connect to alt1.gmail-smtp-in.l.google.com[173.194.65.27]:25: Connection timed out
Mar 19 05:01:18 myserver postfix/smtp[21138]: connect to alt1.gmail-smtp-in.l.google.com[2a00:1450:4013:c00::1b]:25: Network is unreachable
Mar 19 05:01:18 myserver postfix/smtp[21138]: connect to alt2.gmail-smtp-in.l.google.com[2a00:1450:4010:c0b::1b]:25: Network is unreachable 

^ 10分後にもう一度繰り返し、20分後に再び成功しました。この問題の原因に関するアイデアがあれば、よろしくお願いします。

ベストアンサー1

何らかの理由でPostfixはGmailサーバーに接続できません。これはファイアウォールやルーティングの問題が原因である可能性があります。次のコマンドを実行してみてください。

traceroute -T -p 25 <problematic server>

これにより、問題が何であるかを正確に知ることができます。もちろん、これは問題が発生した場合にのみ実行されるため、数回試す必要があるかもしれません。

おすすめ記事