Unable to send email from a ec2 instance using postfix

Solution 1:

This log has two important lines

Mar  7 03:37:32 ip-179-45-37-216 postfix/smtp[24973]: connect to ASPMX.L.GOOGLE.com[2607:f8b0:400e:c02::1b]:25: Network is unreachable
Mar  7 03:37:34 ip-179-45-37-216 postfix/smtp[24973]: 92963C1550: to=<[email protected]>, relay=ASPMX.L.GOOGLE.com[74.125.28.27]:25, delay=1.8, delays=0.09/0/0.17/1.5, dsn    =2.0.0, status=sent (250 2.0.0 OK 1425699441 md9si17726259pdb.104 - gsmtp)

The first line tells us that your server trying to connect Gmail server through IPv6 but it can't because the IPv6 network in your environment was broken. The second line tells us that after the IPv6 failure postfix will fallback to IPv4 mode and send your email via IPv4 address (74.125.28.27).

You can force postfix to disable IPv6 in your postfix via this parameter in main.cf

inet_protocols = ipv4

References: Postfix documentation