Can't send email from Droplet to same domain using Sendmail.

April 8, 2016 2.7k views
Linux Commands System Tools PHP LAMP Stack Linux Basics Configuration Management Ubuntu Email WordPress

I’ve set up two LAMP Droplets with sendmail. One server is sending to the same domain that’s pointing to itself with no problem, however the other one will not send to the same domain as itself.

It’s giving an error of:

050 503-All RCPT commands were rejected with this error:
050 503-unknown user

I’ve set both droplets up in accordance to this guide using the droplet’s respective domains.

Is there something I’ve missed or is there an alternative?

mod edit: fixed the link

2 Answers


It looks like Steve had the same issue, and so he included a solution under ATTENTION! READ THIS…. I’ll copy them here:

  1. Edit /etc/mail/ and add the following lines at the end:

    define(`MAIL_HUB', `')dnl
    define(`LOCAL_RELAY', `')dnl

    Make sure you including the trailing dot!

  2. Run sendmailconfig so that the changes take effect, and restart sendmail just to be 100% sure:

    sudo sendmailconfig  
    sudo service sendmail restart

Once you’ve done that, try sending an email to the same domain and you should see sendmail connecting to your domain’s incoming mailserver(s) in the log file.

I made this changes.. But.. not working for emails(same domains - another domains works).. Using external mx.

Have another answer? Share your knowledge.