Opened 3 weeks ago

Closed 10 days ago

Last modified 10 days ago

#37166 closed New feature (fixed)

System check for developer/test MAILERS in production

Reported by: Mike Edmunds Owned by: Mike Edmunds
Component: Core (Mail) Version: 6.1
Severity: Normal Keywords: checks
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Mike Edmunds)

Add a deployment-only system check that errors if the "default" MAILERS configuration uses the console, dummy, file, or locmem EmailBackend. (Any of Django's built-in backends that are documented as "not intended for use in production".)

The check should only consider the "default" configuration. (Having, e.g., a "test" or "archive" configuration that uses the file backend should not cause an error)

This is recommended early follow-on work from DEP 0018. See also #37161.

Change History (12)

comment:1 by Mike Edmunds, 3 weeks ago

Also, note that the Django 6.1 new project template creates a settings.py with MAILERS configured to use the console EmailBackend, as a reasonable development configuration. (And if that's accidentally left in place in production, the "no default mailer" check from #37161 wouldn't complain.)

comment:2 by Vishy, 3 weeks ago

Owner: set to Vishy
Status: newassigned

comment:3 by Mike Edmunds, 3 weeks ago

Description: modified (diff)

This should probably be an error system check, not warning. Updated the description.

comment:4 by Jacob Walls, 2 weeks ago

Triage Stage: UnreviewedAccepted

comment:5 by Mike Edmunds, 10 days ago

Owner: changed from Vishy to Mike Edmunds

Vishy we're trying to get this in before 6.1 beta, so I'm going to claim the ticket. Apologies if you had already started working on it.

comment:7 by Natalia Bidart, 10 days ago

Patch needs improvement: set

comment:8 by Mike Edmunds, 10 days ago

Patch needs improvement: unset

comment:9 by Natalia Bidart, 10 days ago

Triage Stage: AcceptedReady for checkin

comment:10 by Vishy, 10 days ago

It's fine. I was just waiting for https://github.com/django/django/pull/21529 to be merged, to avoid conflicts.

comment:11 by nessita <124304+nessita@…>, 10 days ago

Resolution: fixed
Status: assignedclosed

In 61e078e:

Fixed #37166 -- Added deploy system check for dev-only 'default' MAILERS.

Added mail.E001 deployment-only system check to detect one of Django's
not-for-production-use email backends in the "default" MAILERS entry.

comment:12 by Natalia <124304+nessita@…>, 10 days ago

In 84eea8d:

[6.1.x] Fixed #37166 -- Added deploy system check for dev-only 'default' MAILERS.

Added mail.E001 deployment-only system check to detect one of Django's
not-for-production-use email backends in the "default" MAILERS entry.

Backport of 61e078ecab9a9e8de9d283adf9fa554b6a145ce8 from main.

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