Sendmail doesn't send email to same domain

Hi, I’m using a thirdy part provider for email boxes and domain registration. From this provider I’ve redirected my domain to a DO VPS running Ubuntu 14.04. Using SENDMAIL if I send an email to (or @otherdomain.ext) all works great, but if I send an email to xyzqwe@SameVPSDomain.ext it doesn’t work. What is the problem? Why from DO droplet I cannot send email to a thirdy part email provider?? Thanks in advance.

Submit an answer

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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


This is happening most likely because your mail service thinks that mail sent to it’s own configured hostname is handled locally. To fix this, open the /etc/mail/ file with your favorite text editor. If you use vim:

vim /etc/mail/

Then go and edit the following. I’m using the domain SameVPSDomain.ext, but you want to replace that with whatever your domain name is.

define(`MAIL_HUB', `SameVPSDomain.ext')dnl
define(`LOCAL_RELAY', `SameVPSDomain.ext.')dnl

Save that, then recompile things and restart sendmail with:

service sendmail restart

This should route mail from your domain using DNS and the MX records for SameVPSDomain.ext instead of routing it locally.