[Django] #30692: Email sent by AdminEmailHandler is sent from <root@localhost>, not from settings.DEFAULT_FROM_EMAIL

5 views
Skip to first unread message

Django

unread,
Aug 9, 2019, 6:51:17 AM8/9/19
to django-...@googlegroups.com
#30692: Email sent by AdminEmailHandler is sent from <root@localhost>, not from
settings.DEFAULT_FROM_EMAIL
-----------------------------------------+------------------------
Reporter: אורי | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
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?

--
Ticket URL: <https://code.djangoproject.com/ticket/30692>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 9, 2019, 7:28:23 AM8/9/19
to django-...@googlegroups.com
#30692: Email sent by AdminEmailHandler is sent from <root@localhost>, not from
settings.DEFAULT_FROM_EMAIL
-------------------------------+--------------------------------------

Reporter: אורי | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.11
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Janez Kranjc):

It's the `SERVER_EMAIL` setting.

Check out the docs:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/30692#comment:1>

Django

unread,
Aug 9, 2019, 7:33:57 AM8/9/19
to django-...@googlegroups.com
#30692: Email sent by AdminEmailHandler is sent from <root@localhost>, not from
settings.DEFAULT_FROM_EMAIL
-------------------------------+--------------------------------------
Reporter: אורי | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 1.11
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Janez Kranjc):

* status: new => closed
* resolution: => invalid


--
Ticket URL: <https://code.djangoproject.com/ticket/30692#comment:2>

Django

unread,
Aug 9, 2019, 8:33:12 AM8/9/19
to django-...@googlegroups.com
#30692: Email sent by AdminEmailHandler is sent from <root@localhost>, not from
settings.DEFAULT_FROM_EMAIL
-------------------------------+--------------------------------------
Reporter: אורי | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 1.11
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by אורי):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/30692#comment:3>

Django

unread,
Aug 10, 2019, 6:08:51 AM8/10/19
to django-...@googlegroups.com
#30692: Email sent by AdminEmailHandler is sent from <root@localhost>, not from
settings.DEFAULT_FROM_EMAIL
-------------------------------+--------------------------------------
Reporter: אורי | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 1.11
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Carlton Gibson):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/30692#comment:4>

Django

unread,
Aug 10, 2019, 7:10:04 AM8/10/19
to django-...@googlegroups.com
#30692: Email sent by AdminEmailHandler is sent from <root@localhost>, not from
settings.DEFAULT_FROM_EMAIL
-------------------------------+--------------------------------------
Reporter: אורי | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 1.11
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by אורי):

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

--
Ticket URL: <https://code.djangoproject.com/ticket/30692#comment:5>

Reply all
Reply to author
Forward
0 new messages