Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#30692 closed Uncategorized (invalid)

Email sent by AdminEmailHandler is sent from <root@localhost>, not from settings.DEFAULT_FROM_EMAIL

Reported by: אורי Owned by: nobody
Component: Uncategorized Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I'm using AdminEmailHandler in Speedy Net to send mail to the admins. My log file contains the following lines:

'handlers': {

'syslog': {

'level': 'DEBUG',
'class': 'logging.handlers.SysLogHandler',
'facility': 'local7',
'address': '/dev/log',
'formatter': 'verbose'

},
'mail_admins': {

'level': 'WARNING',
'class': 'django.utils.log.AdminEmailHandler',
'formatter': 'verbose',

},

},

https://github.com/speedy-net/speedy-net/blob/staging/speedy/core/settings/base.py#L206-L219

But the email I receive (as an admin) from logging is sent to me from <root@localhost>, although I configured a from address (DEFAULT_FROM_EMAIL) and other emails I receive from Django is from the from address (which is different for the staging server)

https://github.com/speedy-net/speedy-net/blob/staging/speedy/core/settings/staging_utils.py#L8

How do I change the from address of email sent to admins from logging?

Change History (5)

comment:1 by Janez Kranjc, 5 years ago

It's the SERVER_EMAIL setting.

Check out the docs:

https://docs.djangoproject.com/en/2.2/topics/email/#mail-admins

comment:2 by Janez Kranjc, 5 years ago

Resolution: invalid
Status: newclosed

comment:3 by אורי, 5 years ago

Thank you, I was not aware about this separate setting.

comment:4 by Carlton Gibson, 5 years ago

Please don't use the issue tracker as a secondary support channel. Please see TicketClosingReasons/UseSupportChannels.

comment:5 by אורי, 5 years ago

I thought it was a bug of Django 1.11. I didn't know it works as expected.

Note: See TracTickets for help on using tickets.
Back to Top