0

I just configured postfix/dovecot on a VPS. I can receive but I cannot send emails to any destination except to gmail which shows my email as a spam. Below are the symptoms:
**Symptom1:** Emails sent to non-gmail addresses:
**example1:**
*Dec 29 07:51:39 tingene postfix/smtp[9815]: connect to smtpin.zoho.com[136.143.191.23]:25: Connection timed out Dec 29 07:51:39 tingene postfix/smtp[9813]: connect to smtpin.zoho.com[136.143.191.23]:25: Connection timed out*

example2:
Dec 29 07:51:39 tingene postfix/smtp[9814]: connect to us2.mx2.mailhostbox.com[208.91.199.202]:25: Connection timed out
Symptom2: Emails sent to gmail addresses and received as spams in gmail:
Dec 29 07:51:53 tingene postfix/smtps/smtpd[9816]: timeout after END-OF-MESSAGE from xxxxxxxxx[xxx.xxx.xxx.xxx] Dec 29 07:51:53 tingene postfix/smtp[9821]: connect to gmail-smtp-in.l.google.com[74.125.137.26]:25: Connection timed out
Dec 29 07:51:55 tingene postfix/smtp[9821]: 848A52111D: to=myemail@gmail.com, relay=gmail-smtp-in.l.google.com[2607:f8b0:4023:c03::1b]:25, delay=32, delays=0.42/0.02/30/0.81, dsn=2.0.0, status=sent (250 2.0.0 OK 1609228315 d17si42881479pgg.14 - gsmtp)

My ISP is not blocking port 25. This is the proof:
root@tingene:/var/log# telnet gmail-smtp-in.l.google.com 25
Trying 2607:f8b0:4023:c03::1b...
Connected to gmail-smtp-in.l.google.com.
Escape character is '^]'.
220 mx.google.com ESMTP v10si41545875plz.191 - gsmtp ^]

Any advice is appreciated.

1 Answers1

1

Your ISP is not blocking port 25/TCP on IPV6 connections but seems to block this port on IPV4 connections:

  • the test you did with telnet used IPV6.
  • The logfile snippets you posted show that your server tried to connect to the google smtp server two times. first time via IPV4 (failed), second time via IPV6 (succeeded).
Marc
  • 121
  • 4
  • Thank you for your feedback. I will try to see if I can configure postfix to use IPV6. – ザカリアسعيد Dec 29 '20 at 10:52
  • https://serverfault.com/questions/565107/when-does-postfix-use-ipv6-and-when-ipv4 But this will most likely not fix your problem because you can't count on other mailservers beeing reachable via IPV6. Most VPS providers block the SMTP port by default. Usually you can ask them to unblock the SMTP port for server or a provisioned IP. – Marc Dec 29 '20 at 13:25
  • My VPS provider opened port 25 for my VPS. I can now send emails. I also added a PTR record which solved the issue of marking my emails as SPAM by gmail. Thank you very much Marc. – ザカリアسعيد Dec 30 '20 at 00:16