Opened 7 years ago

Closed 7 years ago

Last modified 7 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:…, nreilly@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


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.


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 Changed 7 years ago by EroSennin

  • Cc… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 7 years ago by anonymous

  • Cc nreilly@… added

comment:3 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r9197.

comment:4 Changed 7 years ago by mtredinnick

(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 Changed 7 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

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