Modify ↓
Opened 15 years ago
Closed 15 years ago
#5679 closed defect (fixed)
From header encoded incorrectly
Reported by: | Erik M. Bray | Owned by: | Robert Corsaro |
---|---|---|---|
Priority: | normal | Component: | AnnouncerPlugin |
Severity: | normal | Keywords: | header encoding |
Cc: | Trac Release: | 0.11 |
Description
According to RFC 5322 only the display name and the local part of the e-mail address in the From header can be quoted strings. But the announcer pluguin currently tries to encode the entire string of "display-name" <local@domain>
which will break. You end up with everything up to the @ encoded, including the left angle bracket, which is incorrect.
The fix should look something like this:
-
announcerplugin/distributors/email_distributor.py
291 291 del rootMessage['Content-Transfer-Encoding'] 292 292 rootMessage.set_charset(self._charset) 293 293 rootMessage['Subject'] = Header(subject, self._charset) 294 from_header = '"%s" <%s>'%(self.smtp_from_name or proj_name, 295 self.smtp_from) 294 from_header = '"%s" <%s>' % \ 295 (Header(self.smtp_from_name or proj_name, self._charset), 296 self.smtp_from) 296 297 rootMessage['From'] = from_header 297 298 if self.smtp_always_bcc: 298 299 rootMessage['Bcc'] = self.smtp_always_bcc
Attachments (0)
Note: See
TracTickets for help on using
tickets.
(In [7141]) From header encoding canonized fixes #5679 Thanks ebray!