By andrewl85
I set up an SMTP server on a CentOS 7 droplet. Emails are successfully being sent to Gmail accounts, but they are failing to send to my G Suite email accounts.
Successful email:
Jan 1 13:35:48 Production postfix/smtp[2869]: E5B653FDBA: to=personal_email_address@gmail.com, relay=gmail-smtp-in.l.google.com[209.85.144.27]:25, delay=877, delays=876/0.02/0.31/0.25, dsn=2.0.0, status=sent (250 2.0.0 OK 1483295748 k58si25466087qta.76 - gsmtp)
Failed email:
Jan 1 13:35:48 Production postfix/lmtp[2871]: E5B653FDBA: to=root@example.com, orig_to=support@example.com, relay=none, delay=876, delays=876/0.02/0.02/0, dsn=4.4.1, status=deferred (connect to example.com[/var/lib/imap/socket/lmtp]: No such file or directory) Jan 1 13:35:48 Production postfix/smtp[2869]: connect to gmail-smtp-in.l.google.com[2607:f8b0:400d:c0e::1b]:25: Network is unreachable
I replaced my domain name with example.com above.
I was able to fix the “Network is unreachable” by opening /etc/postfix/main.cf and setting the following:
inet_protocols = ipv4
However, the other error is still present, and emails are still failing to send to my domain accounts:
Jan 1 17:22:38 Production postfix/lmtp[4066]: 9EC3E3FE3C: to=root@example.com, orig_to=support@example.com, relay=none, delay=1104, delays=1104/0.03/0.01/0, dsn=4.4.1, status=deferred (connect to example.com[/var/lib/imap/socket/lmtp]: No such file or directory)
Why is Postfix able to send emails to all domains except the one that it’s running from? How can this be fixed?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Since the hostname of the server matches the domain, it tries to deliver locally instead. Turn it off.
Thanks for responding, but what exactly do I turn off? Are you referring to a certain setting in the main.cf file?
I think I figured it out. I opened /etc/postfix/main.cf file and changed this line:
mydestination = $myhostname, localhost
to:
mydestination = localhost
Then I ran ‘service postfix restart’ to restart Postfix. It’s sending emails to my domain now. Thanks for your help!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.