I have just installed Postfix and while recieving email seems to work fine, I have trouble sending email.
When I send mail to an address provided by my ISP, the mail gets delivered successfully. The problems start when I send a mail to a gmail address.
When I check the mail queue, I can see the email is stuck:
myuser@My-Server:~$ mailq -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient------- 7580BB40C58 551 Sat Apr 23 18:30:27 firstname.lastname@example.org (connect to alt2.gmail-smtp-in.l.google.com[22.214.171.124]:25: Connection timed out) email@example.com -- 0 Kbytes in 1 Request.
You can see it says
Connection timed out. The problems get confirmed when I check postfix.log:
Apr 23 18:30:27 My-Server postfix/pickup: 7580BB40C58: uid=1000 from=<myuser> Apr 23 18:30:27 My-Server postfix/cleanup: 7580BB40C58: message-id=<20160423163027.7580BB40C58@mail.mydomain.nl> Apr 23 18:30:27 My-Server postfix/qmgr: 7580BB40C58: from=<firstname.lastname@example.org>, size=551, nrcpt=1 (queue active) Apr 23 18:30:27 My-Server postfix/smtp: connect to gmail-smtp-in.l.google.com[2a00:1450:4013:c01::1a]:25: Network is unreachable Apr 23 18:30:57 My-Server postfix/smtp: connect to gmail-smtp-in.l.google.com[126.96.36.199]:25: Connection timed out Apr 23 18:31:27 My-Server postfix/smtp: connect to alt1.gmail-smtp-in.l.google.com[188.8.131.52]:25: Connection timed out Apr 23 18:31:27 My-Server postfix/smtp: connect to alt1.gmail-smtp-in.l.google.com[2404:6800:4003:c02::1b]:25: Network is unreachable Apr 23 18:31:57 My-Server postfix/smtp: connect to alt2.gmail-smtp-in.l.google.com[184.108.40.206]:25: Connection timed out Apr 23 18:31:58 My-Server postfix/smtp: 7580BB40C58: to=<email@example.com>, relay=none, delay=91, delays=0.17/0.01/90/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[220.127.116.11]:25: Connection timed out)
Connection timed out. It retries every few minutes automatically, and fails everytime.
mail.cf files looks like this:
myhostname = mail.mydomain.nl alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = mail.mydomain.nl, My-Server, , localhost, mydomain.nl relayhost = mynetworks = 127.0.0.0/8 192.168.1.0/24 10.8.0.1/32 [::1]/128 [fe80::]/64 mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all # Uncomment the next line to generate "delayed mail" warnings #delay_warning_time = 4h inet_protocols = all
I have my own domain name and think I have configured its DNS settings correctly. I also think I have set the name correctly on my server, but I am not entirely sure. Please note I do not want to relay my mail through gmail servers, but just send mail to them.
The server runs Ubuntu Server 14.04 LTS.
If someone could help me with this problem, it would be greatly appreciated.