Amazon-ses -Error: 554, b'Message rejected: Email address is not verified?

Viewed 1095

I want to use Amazon's Simple Email Service to send emails.

I verified my domain as well as the email address I want to send from. I'm not in sandbox mode.

I'm able to receive email when I sign up but when I try to reset the password I get SMTPDataError with exception

(554, b'Message rejected: Email address is not verified. The following identities failed the check in region AP-SOUTH-1: webmaster@localhost')

How can this issue be resolved?

2 Answers

As it shows in the error message, Django is using webmaster@localhost for sending the email through Amazon SES. However, webmaster@localhost is an unverified email and one that is not possible to verify. The intended FROM email address must be a different one but by default Django uses webmaster@localhost.

To resolve this add a property in settings.py file of project

DEFAULT_FROM_EMAIL = 'yourmail@yourdomain.com>'

so that Django uses your intended FROM email address.

The 554 error happens due to

'554 message rejected for policy reasons' – What this means? In a mail delivery, the recipient server performs a series of checks to verify the authenticity of the sender and the message. If the recipient server has doubt in the sender's authenticity or the sender's message, it rejects such emails

As user @GAEfan mentioned in the comments you are trying to run this from your localhost as shown here in the exception webmaster@localhost without a verified email. Follow the guide here to ensure everything is verified.

Running this in a production environment wouldn't yield this error. if you have already verified it in the sandbox following the guide here, this should suffice.

Related