Postfix: status=deferred (connect to gmail-smtp-in.l.google.com[142.250.27.26]:25: Connection timed out)
Postfix could not reach the remote mail server on port 25, so the message stays in the queue and is retried.
status=deferred (connect to gmail-smtp-in.l.google.com[142.250.27.26]:25: Connection timed out)postfix/smtp status=deferred Connection timed outstatus=deferred (connect to ... Connection refused)postfix queue deferred connection timed out Meaning
postfix/smtp logs the destination and reason. A timeout usually means outbound port 25 is blocked by your host or ISP (very common on cloud providers), a firewall rule, or a routing problem. Use a smarthost/relay on port 587 or 2525 instead of direct delivery.
Common causes
- Outbound port 25 blocked by the cloud provider/ISP
- Firewall or security group denies egress
- Remote server down or blocking your IP
- IPv6 route broken while Postfix prefers IPv6
- DNS returning unreachable MX
⚡ Quick fix
- Test
nc -vz gmail-smtp-in.l.google.com 25from the server - Configure a relayhost with port 587 and SASL credentials
- Force IPv4:
inet_protocols = ipv4
Detailed fix by platform
Linux
postqueue -p(list),postsuper -d ALL deferred(clear), andgrep status=deferred /var/log/mail.log | tail
Code examples
Relay through a smarthost (main.cf)
relayhost = [smtp.example.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encryptHow to diagnose
- Port — nc to port 25 succeeds?
- Egress — Firewall/cloud rules?
- IPv6 — Fails over IPv6 only?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- 421 4.7.0 Try again later (rate limited) SMTP: 421 4.7.0 Our system has detected an unusual rate of unsolicited mail originating from your IP address. Mail sent from your IP address has been temporarily rate limited
- 450 4.7.1 Greylisted, please try again later SMTP: 450 4.7.1 <user@example.com>: Recipient address rejected: Greylisted, see http://postgrey.schweikert.ch/help/example.com.html
- 451 4.3.0 Local error in processing SMTP: 451 4.3.0 Error: queue file write error / 451 Requested action aborted: local error in processing
Most viewed in Email / SMTP
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 4 Nov 2026