Drupal - Unable to send e-mail via sendmail, because User is unknown

This error appeared after I've changed my host name from webserver to webserver.com, thus anything sent to *@webserver.com confused sendmail, as it's been searching local user with such name.

Adding a local user won't solve the problem completely, because if you try adding user like firstname.lastname, Linux system will complain.

What I've done though to fix my system, is configuring sendmail properly:

  1. Modify /etc/mail/sendmail.mc by adding following lines to the very end:

    define('MAIL_HUB', 'webserver.com.');
    define('LOCAL_RELAY', 'webserver.com.');
    
  2. Run:

    sudo sendmailconfig
    

Optionally reloaded the sendmail by:

service sendmail restart

On some Linux distributions (such as Ubuntu) it may be reloaded automatically.

Tags:

7

Emails