Score:0

Ubuntu PostFix smtp.gmail.com Connection timed out / Network is unreachable

gm flag

So, i have a postfix mail server set up, and when i run the following command:

telnet smtp.gmail.com 25
------------------------------------
Trying 142.250.147.108...
Trying 2a00:1450:4025:c01::6d...
telnet: Unable to connect to remote host: Network is unreachable

But when i try to send an email:

root@vps:~# mail -a FROM:[email protected] *my address*@gmail.com
Cc: mail
Subject: test
test

Then the log says:

Feb  8 19:11:15 chatenium postfix/local[3680]: 9E6654D6A3: to=<mail@chatenium>, relay=local, delay=0.08, delays=0.05/0.01/0/0.03, dsn=2.0.0, status=sent (delivered to mailbox)
Feb  8 19:11:27 chatenium postfix/smtp[3669]: connect to gmail-smtp-in.l.google.com[142.250.27.27]:25: Connection timed out
Feb  8 19:11:45 chatenium postfix/smtp[3681]: connect to gmail-smtp-in.l.google.com[142.250.27.27]:25: Connection timed out

Can you tell me why? Thanks!

Zareh Kasparian avatar
us flag
The reason for the "Network is unreachable" error in this log entry is likely due to a IPv6 connectivity to the Gmail SMTP server with the Source of IPv4 address
vidarlo avatar
ar flag
SMTP doesn't use port 465. It uses port 25.
Score:1
ar flag

Your IPv6 configuration is broken. Either fix it, or tell Postfix to only use IPv4.

Edit /etc/postfix/main.cf and change inet_protocols = all to inert_protocols = ipv4 to force Postfix to only ever use IPv4.

Craft Alma avatar
gm flag
after restarting, it now gives error ```Connection timed out```
Craft Alma avatar
gm flag
updated the question
vidarlo avatar
ar flag
You have some (probably external) firewall that blocks connections on port 25 - probably to reduce spam.
Craft Alma avatar
gm flag
Let me ask my provider, i will comment what they said
blockhead avatar
bg flag
what did they say?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.