Article 6M0GC Local POSTFIX cannot send to Gmail

Local POSTFIX cannot send to Gmail

by
banderas20
from LinuxQuestions.org on (#6M0GC)
Hi.

I have set up a POSTFIX server in an AWS EC2 instance. If I try to send emails between local users using Sendmail, it works.

However, if I try with an external account (gmail for example), it doesn't work.

Command:

Code:echo "test email" | sendmail account@gmail.comPOSTFIX Log:

Code:postfix/smtp[2108]: CD4FE4652F: to=<account@gmail.com>, relay=none, delay=150, delays=0.02/0.02/150/0, dsn=4.4.1, status=deferred (connect to alt4.gmail-smtp-in.l.google.com[142.250.153.26]:25: Connection timed out)

from=<ubuntu@srv.ec2.internalTelnet output:
Code:telnet gmail-smtp-in.l.google.com 25
Trying 172.253.63.27...Finally, here is my main.cf file:

Code:smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = abdsrvr.ec2.internal
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, srvr, localhost.localdomain, , localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
#inet_protocols = all
inet_protocols = ipv4I have port 25 open in the AWS SG.

My guess is that it has something to do with the domain, since my machine is bound to a local domain (ec2.internal), without any DNS record. Maybe GMAIL and other public SMTP servers reject this kind of connections. Anyway, I'd appreciate some help on this.

Thanks!
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments