Question

Sendmail user unknown error

Hi,

sendmail is set up correctly. Emails arrive at email addresses other than my domain or host name.

Is it possible to ignore – or something like that – the local host/domain?

System: Ubuntu 15.04 with LEMP stack.


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.

Hi! I know this was posted a while ago but I hope this helps anyone who is experiencing the same issue and happens to come across this question in the future:

This happens by default because your domain name matches either your server’s hostname or a setting in sendmail’s config file. You can force sendmail to send emails to your actual mail server instead of itself by following these steps:

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

    define(`MAIL_HUB', `domain.com.')dnl
    define(`LOCAL_RELAY', `domain.com.')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.