이메일 전달 지연을 디버깅하는 방법은 무엇입니까?

이메일 전달 지연을 디버깅하는 방법은 무엇입니까?

서버에서 일어나는 일에 대한 알림을 받으려면 간단한 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>

그러면 문제가 무엇인지 정확히 알 수 있습니다. 물론 이것은 문제가 발생한 경우에만 수행되므로 몇 번 시도해야 할 수도 있습니다.

관련 정보