Opened 14 years ago

Closed 14 years ago

Last modified 13 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: no UI/UX: no

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 14 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by canburak, 14 years ago

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

comment:2 by Andi Albrecht, 14 years ago

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

by Andi Albrecht, 14 years ago

Attachment: trac13259.diff added

comment:3 by Russell Keith-Magee, 14 years ago

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

comment:4 by Russell Keith-Magee, 14 years ago

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 by Russell Keith-Magee, 14 years ago

(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 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

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