Recently  I got below mentioned sendmail error in syslog when I was trying to create a user in a python web application.

relay=localhost [], reject=553 5.5.4 <>... Domain name required for sender address "myapp"

or below error if you are using python smtp library

File "/usr/lib/python2.7/", line 733, in sendmail
raise SMTPRecipientsRefused(senderrs)
SMTPRecipientsRefused: {u'': (553, '5.5.4 ... Domain name required for sender address myapp

And I found that sendmail is throwing this error because the sender address configured in the python script was not a FQDN (, But I was able fix this issue without a FQDN hostname by whitelisting my hostname (myapp) to sendmail config file.

How to fix this error ?

To fix this error all you have to do is , Open below file in a text editor and add your hostname to it.

nano /etc/mail/local-host-names

Then restart sendmail service

sudo service sendmail restart 

That’s it.

How to fix Domain name required for sender address error in sendmail
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: