#37161: Implement a system check for no default MAILERS configuration
-------------------------------------+-------------------------------------
     Reporter:  Jacob Walls          |                    Owner:  Bader
                                     |  Eddine Benhirt
         Type:  New feature          |                   Status:  assigned
    Component:  Core (Mail)          |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Mike Edmunds):

 * cc: Natalia Bidart (added)

Comment:

 Replying to [comment:13 Jacob Walls]:
 > Replying to [comment:6 Mike Edmunds]:
 > > * Projects that haven't configured `MAILERS` because they don't send
 mail will need to silence the check. Are we OK with that? 🤔
 >
 > I guess the alternative would be to limit the check to the circumstance
 where at least one deprecated `EMAIL_*` setting is present, like we do for
 the deprecation warning if I recall correctly.

 A few thoughts:

 * In Django 7.0, if `MAILERS` is not defined, any attempt to send mail
 will raise a `MailerDoesNotExist` error. There's no risk of ''silent''
 data loss (like what seems to have been the concern with `STORAGES`).
 * #35674 (accepted) will add a generalized system check for all (or most?)
 previously-deprecated settings once they are removed. So the `EMAIL_*`
 settings could be added to that check when they are removed in 7.0. (I
 don't think we should create a separate check just for old email
 settings.)
 * #37166 (awaiting triage) is the other system check suggested in the DEP,
 to warn when a development-only email backend is configured as the default
 mailer in production. Now that the console backend is the default in the
 new project template. I think that's a more-likely scenario for easily-
 overlooked data loss (in some broad sense of "loss", e.g., password reset
 emails that end up printed to a log rather than sent).

 Some relevant discussions during feature development (cc Natalia):
 * Having a [https://github.com/django/deps/pull/105#discussion_r2807907290
 system check to detect] a missing `"default"` entry in `MAILERS`
 * Avoiding noisy (deprecation) warnings
 [https://github.com/django/django/pull/21052#discussion_r3156662085 for
 projects that don't use mail]

 Perhaps this "no default mailer" check should only run if `MAILERS` is
 ''explicitly'' defined in settings.py—not warn if it's an empty dict
 because of the Django 7.0 default value.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/37161#comment:14>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019ecc636475-2c7fa587-7778-4b9a-948f-e53999036dc6-000000%40eu-central-1.amazonses.com.

Reply via email to