Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#13259 closed (fixed)

multiple calls to message() breaks the mail content

Reported by: canburak Owned by: nobody
Component: Core (Mail) Version: 1.1-beta
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: no
Easy pickings: UI/UX:

Description

The message() function from django/core/mail/message.py pop's out From header from extra_headers, so as a side effect, multiple calls to message() generates an email which has the from_email in the From header, instead of the one set in the headers.

As a quick fix, one can reset "From" in extra headers just after calling the message().

Attachments (1)

trac13259.diff (1.8 KB) - added by Andi Albrecht 7 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 7 years ago by canburak

If this is not a design decision, replacing pop with get will solve the problem.

comment:2 Changed 7 years ago by Andi Albrecht

IMO replacing pop with get is a good solution. I see no reason why a call to message() should change the extra_headers dictionary.

Changed 7 years ago by Andi Albrecht

Attachment: trac13259.diff added

comment:3 Changed 7 years ago by Russell Keith-Magee

Has patch: set
milestone: 1.2
Needs tests: set
Triage Stage: UnreviewedAccepted

comment:4 Changed 7 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [12901]) Fixed #13259 -- Ensure that multiple calls to message() don't corrupt any extra message headers. Thanks to canburak for the report, and Andi Albrecht for the fix.

comment:5 Changed 7 years ago by Russell Keith-Magee

(In [12902]) [1.1.X] Fixed #13259 -- Ensure that multiple calls to message() don't corrupt any extra message headers. Thanks to canburak for the report, and Andi Albrecht for the fix.

Backport of r12901 from trunk.

comment:6 Changed 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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