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


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

or below error if you are using python smtp library


File "/usr/lib/python2.7/smtplib.py", line 733, in sendmail
raise SMTPRecipientsRefused(senderrs)
SMTPRecipientsRefused: {u'app@gmail.com': (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 (someone@example.com), 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.

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.