简体   繁体   中英

Django admin emails are not sending properly

I'm not sure why my error logging is not working. When I try to log an error with a logger that has the default 'mail_admins' handler, no email is sent even though SERVER_EMAIL and ADMINS appear to be properly defined. Looking in the postfix logs, I get this line whenever I try to send one of these emails:

Nov 20 11:55:58 localhost postfix/smtpd[1027]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 550 5.1.1 <g>: Recipient address rejected: User unknown in local recipient table; from=<no-reply@mydomain.com
> to=<g> proto=ESMTP helo=<localhost>

Why would it be trying to send the email to 'g' rather than the specified admin email?

Edit: By the way, send_mail does work correctly.

ADMINS = ( ('John Doe','some_email@that-isnt-just-g.com') )

Should be:

ADMINS = [ ('John Doe','some_email@that-isnt-just-g.com') ]

Or:

ADMINS = ( ('John Doe','some_email@that-isnt-just-g.com'), )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM