I have installed postfix mail server in Ubuntu machine. I am facing some issues with the mail sending to other domain mail servers (Google, Yahoo, Outlook...). I am using virtual domain to send the email using SMTP of the mail server (say firstname.lastname@example.org)
When I try to send multiple emails through postfix SMTP, its failed to send the mails. Sometimes they get successfully sent and sometimes its fail. However, if I try to send the same using the relayhost, its working without any issues. [I could not use the relayhost (say gmail relay server), since it wont provide the option to set sender email id as my own and it has its own limits (500 per day something like that)]
Following error messages available in mail.log file.
Jan 14 11:40:25 server1 postfix/smtp: connect to gmail-smtp-in.l.google.com[2607:f8b0:400e:c02::1a]:25: Network is unreachable Jan 14 11:41:25 server1 postfix/smtp: 6F11361C56: to=<email@example.com>, relay=none, delay=61, delays=0.71/0/60/0, dsn=4.4.1, status=deferred (connect to alt2.gmail-smtp-in.l.google.com[2607:f8b0:4002:c09::1b]:25: **Network is unreachable**) Jan 14 07:33:42 server1 postfix/smtp: 1BE9261CF6: to=<firstname.lastname@example.org>, relay=none, delay=151, delays=0.68/0/150/0, dsn=4.4.1, status=deferred (connect to mx4.hotmail.com[22.214.171.124]:25: **Connection timed out**)
I have tried to change the
inet_protocols value to
ipv4 in the file
/etc/postfix/main.cf and restarted postfix server. But it wont fix the issue.
- Mailserver hosted in Amazon EC2 instance with a static IP address (connect to internet, and all traffic ports are opened for inbound and outbound in security groups).
- Telnet to the port 25 of the specific SMTP server is working randomly (sometimes works and sometimes not).
- Ping to the SMTP server is always successful (Telnet to port 25 fails most of the time).
- I am using self signed certificate in my Mail server.
Can any one let us know, how to fix this issue. Is this something we need to look into our mail server configuration?