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.
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