1

I'm trying to troubleshoot a problem with my postfix server not sending email to my GMail account (as a test).

From /var/log/mail.log:

Jan  6 07:46:37 todo postfix/smtp[5818]: connect to alt1.gmail-smtp-in.l.google.com[64.233.186.27]:25: Connection timed out
Jan  6 07:46:37 todo postfix/smtp[5818]: connect to alt2.gmail-smtp-in.l.google.com[2a00:1450:400b:c00::1b]:25: Network is unreachable
Jan  6 07:46:37 todo postfix/smtp[5818]: 334FF1391C9: to=<me@gmail.com>, relay=none, delay=1443, delays=1383/0.01/60/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[2a00:1450:400b:c00::1b]:25: Network is unreachable)

I don't want to relay via gmail, but the receiving email is at a gmail address. Is postfix trying to use gmail as a relay somehow?

In /etc/postfix/main.cf I have:

relay_host = 
Jason
  • 141

2 Answers2

3

From another answer on StackOverflow: it looks like Amazon blocks outbound traffic on port 25, and a request has to be submitted to have this block removed:

https://aws.amazon.com/premiumsupport/knowledge-center/ec2-port-25-throttle/?nc1=h_ls

Thanks to Gerald for pointing out it was a firewall issue!

Jason
  • 141
-2
Misguided error message may lead to check DNS resolution in `/etc/resolve.conf` or [disabling ipv6][1]. But non of them is useful.

For me this is happens because of Gmail detect my sender email address as SPAM. So checking spam folder and remove my sender from there solve the problem.


Beside that you can check postfix by doing these steps:

  • postfix logs: tail -f /var/log/mail.log or /var/log/mail.error

  • check postfix configuration file /etc/postfix/main.cf and differentiate with some valid one.

  • Some mail servers like gmail/yahoo enforce use DNS record security like spf, dmarc, dkim. You must enable them in you DNS server. I'm using cloudflare free account as DNS server.

Its very important step to run postfix mail server. If these records not set correctly, you cant send mail to some servers.

  • Use online services to confirm DNS records

https://mxtoolbox.com/

In domain name use your fqdn i.e. example.com not mail.example.com

If all things are OK

DNS record check

mail-tester.com is a great tool to check mail delivery and inform misconfiguration.

send test email to temporary address and then check it out. If all things OK, you can see below report.

mail-tester.com


Great explanation about email DNS record by Christian Lempa

DNS record for mail

Some related links

EsmaeelE
  • 119