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.

Categories: Tutorials

shyam jos

My name is Shyam Jos, I am a passionate Linux system administrator from Kochi, India. I am a strong advocate of using Linux and Open-Source software.

1 Comment

wondaboi · September 20, 2018 at 9:28 AM

SMTPSenderRefused: (553,’5.5.4 … Real domain name required for sender address’, ‘”mis@localhost.localdomain” /”)

i get this when i tried sender mails with turbo mailer

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.