[Django] #37161: Implement a system check for deprecated mail settings

3 views
Skip to first unread message

Django

unread,
Jun 11, 2026, 4:09:09 PM (3 days ago) Jun 11
to django-...@googlegroups.com
#37161: Implement a system check for deprecated mail settings
-----------------------------+-------------------------------------------
Reporter: Jacob Walls | Type: New feature
Status: new | Component: Core (Mail)
Version: 6.0 | Severity: Release blocker
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+-------------------------------------------
Because the deprecated mail settings will stop working in Django 7.0, this
could lead to data loss if someone misses the deprecation warnings and
fails to migrate to `MAILERS`.

For a similar scenario with `STORAGES`, on the forum we
[https://forum.djangoproject.com/t/deprecation-of-default-file-storage-
can-we-easen-the-migration/34284/20 appeared to agree] that in retrospect,
we should have implemented a temporary system check in
`core.checks.compatibility` despite some disagreement about what a more
robust, permanent solution might look like for retiring settings.

An example where this was implemented before is in
354acd04af524ad82002b903df1189581c51cabe, although it's not a perfect
analogue because that check only checked for ''conflicts'' between old &
new settings--which we do have right now in 6.1, raising a runtime
`ImproperlyConfigured`--not the presence of the old settings at all.

(Interestingly, the `ImproperlyConfigured` is swallowed by `manage.py
shell`...)

Anyway, I think we should consider adding a system check during the
deprecation period.
--
Ticket URL: <https://code.djangoproject.com/ticket/37161>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 11, 2026, 4:09:18 PM (3 days ago) Jun 11
to django-...@googlegroups.com
#37161: Implement a system check for deprecated mail settings
---------------------------------+--------------------------------------
Reporter: Jacob Walls | Owner: (none)
Type: New feature | Status: new
Component: Core (Mail) | Version: 6.1
Severity: Release blocker | Resolution:
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 Jacob Walls):

* version: 6.0 => 6.1

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

Django

unread,
Jun 11, 2026, 5:02:58 PM (3 days ago) Jun 11
to django-...@googlegroups.com
#37161: Implement a system check for deprecated mail settings
---------------------------------+--------------------------------------
Reporter: Jacob Walls | Owner: (none)
Type: New feature | Status: new
Component: Core (Mail) | Version: 6.1
Severity: Release blocker | 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 Mike Edmunds):

Note DEP 0018 contemplates two similar
[https://github.com/django/deps/blob/main/accepted/0018-mailers.md#future-
system-checks MAILERS-related system checks] as future work.

The "Missing `"default"` alias in `MAILERS`" check would catch this
starting in 7.0 (because MAILERS defaults to `{}` starting in 7.0).
--
Ticket URL: <https://code.djangoproject.com/ticket/37161#comment:2>

Django

unread,
Jun 11, 2026, 5:04:26 PM (3 days ago) Jun 11
to django-...@googlegroups.com
#37161: Implement a system check for deprecated mail settings
---------------------------------+--------------------------------------
Reporter: Jacob Walls | Owner: (none)
Type: New feature | Status: new
Component: Core (Mail) | Version: 6.1
Severity: Release blocker | 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 Mike Edmunds):

[Jacob, this would be release blocker for 7.0, right? Not for 6.1.]
--
Ticket URL: <https://code.djangoproject.com/ticket/37161#comment:3>

Django

unread,
Jun 11, 2026, 5:27:01 PM (2 days ago) Jun 11
to django-...@googlegroups.com
#37161: Implement a system check for deprecated mail settings
-----------------------------+--------------------------------------
Reporter: Jacob Walls | Owner: (none)
Type: New feature | Status: new
Component: Core (Mail) | Version: dev
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
-----------------------------+--------------------------------------
Changes (by Jacob Walls):

* severity: Release blocker => Normal
* version: 6.1 => dev

Comment:

Ah, I didn't realize that was the plan. That would be sufficient, I think.
--
Ticket URL: <https://code.djangoproject.com/ticket/37161#comment:4>

Django

unread,
Jun 12, 2026, 11:29:08 AM (2 days ago) Jun 12
to django-...@googlegroups.com
#37161: Implement a system check for deprecated mail settings
-----------------------------+------------------------------------
Reporter: Jacob Walls | Owner: (none)
Type: New feature | Status: new
Component: Core (Mail) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by Natalia Bidart):

* stage: Unreviewed => Accepted

Comment:

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

Django

unread,
Jun 12, 2026, 7:25:24 PM (2 days ago) Jun 12
to django-...@googlegroups.com
#37161: Implement a system check for deprecated mail settings
-----------------------------+------------------------------------
Reporter: Jacob Walls | Owner: (none)
Type: New feature | Status: new
Component: Core (Mail) | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Comment (by Mike Edmunds):

So the goal is a system check that warns if `"default" not in
settings.MAILERS`. Couple of questions:
* Projects that haven't configured `MAILERS` because they don't send mail
will need to silence the check. Are we OK with that? 🤔
* None of the [https://docs.djangoproject.com/en/6.1/ref/checks/#builtin-
tags built-in tags] seem to apply. I'm thinking we should add a tag for
`mail`?

Other notes:
* This check could be added immediately, but before 7.0 the test will need
to be `hasattr(settings, "MAILERS") and …` (because `MAILERS` doesn't
exist by default until 7.0).
* Suggested `msg`: "There is no 'default' configuration in your MAILERS
setting."
* Suggested `hint`:
* If `MAILERS` is empty: "Sending email will cause an error."
* If `MAILERS` has other keys: "Sending email without specifying 'using'
will cause an error."
--
Ticket URL: <https://code.djangoproject.com/ticket/37161#comment:6>
Reply all
Reply to author
Forward
0 new messages