#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 , 16 years ago
Cc: | added |
---|
comment:2 by , 16 years ago
Cc: | added |
---|
comment:3 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 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.
Fixed in r9197.