Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#9233 closed (fixed)

EmailMessage.message() duplicates data from extra_headers

Reported by: kostaz Owned by: nobody
Component: Core (Mail) Version: 1.0
Severity: Keywords:
Cc: densetsu.no.ero.sennin@…, nreilly@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If I have "Date" and "Message-ID" in extra_headers, the message() method of the EmailMessage will first create default ones and then add the ones specified in the extra_headers, thus creating duplicates. A proposed solution to this is to check if they were specified in extra_headers and use those, instead of creating default ones.

i.e.

if not 'Date' in self.extra_headers: 
    msg['Date'] = formatdate()
if not 'Message-ID' in self.extra_headers:
    msg['Message-ID'] = make_msgid()

Change History (5)

comment:1 by Andrey Golovizin, 16 years ago

Cc: densetsu.no.ero.sennin@… added

comment:2 by anonymous, 16 years ago

Cc: nreilly@… added

comment:3 by Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: newclosed

Fixed in r9197.

comment:4 by Malcolm Tredinnick, 16 years ago

(In [9198]) [1.0.X] Fixed #9233 -- Allow date and message-id headers to be passed in
manually in email messages. Previously we were creating duplicate headers,
which was bad.

Backport of r9197 from trunk. I'm calling this a bugfix, since the docs are
unclear about which headers you can pass into an EmailMessage constructor.

comment:5 by (none), 16 years ago

milestone: post-1.0

Milestone post-1.0 deleted

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