2

In order to get notified about some stuff going on on a server, I use simple mailutils command executed @hourly by cron:

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

where $receivers is a list of a few email addresses. Sometimes this solution works pretty smoothly, however, most of the time delivering to all email addresses delays for specific amount of time (~30 mins). This delay time is always the same.

In /var/log/mail.log I can see a bunch of this kind of messages:

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 

^ That repeats again after 10 minutes and next time successfully after 20 more minutes. I would appreciate any ideas on what could cause this.

5
  • Did you ever resolve your issue? I have exactly the same problem, with exactly the same host names. I'm unable to forward email to gmail reliably. I am wondering if gmail is blocking or rate limiting my server. Emails are arriving eventually, though sometimes delayed by a few days. This all started after some messages about a full volume, although that is no longer an issue. My host is on AWS. Jul 25 '18 at 20:40
  • @DrewNoakes sorry mate, this has not been solved. The server admins ended up with prohibiting emailing to gmail host due to some security stuff so I never got back to this problem. Hope you'll find a solution!
    – hdf
    Jul 26 '18 at 20:15
  • Thanks for getting back to me. I'm considering reinstalling Postfix. Maybe something became corrupted when the volume was full. Jul 26 '18 at 21:25
  • I'm on AWS EC2 and they have some outbound mail limiting that may be the cause of the problem: aws.amazon.com/forms/ec2-email-limit-rdns-request Jul 26 '18 at 21:39
  • Might be a bit early to tell, but so far it looks as though making that request sorted the problem. I should point out, to others considering this solution, that I was getting some email, but not all. Most people online seem to have an absolute connection issue, usually related to port 25 being blocked or so forth. Jul 27 '18 at 16:03
1

Postfix can't connect to the gmail servers for some reason. This may be due to a firewall or routing issue. Try running the following command:

traceroute -T -p 25 <problematic server>

This should tell you exactly where the problem is located. Of course, if will only do so while the problem is happening, so you may need to try a few times...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.