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

     
    291291        del rootMessage['Content-Transfer-Encoding']
    292292        rootMessage.set_charset(self._charset)
    293293        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)
    296297        rootMessage['From'] = from_header
    297298        if self.smtp_always_bcc:
    298299            rootMessage['Bcc'] = self.smtp_always_bcc

Attachments (0)

Change History (1)

comment:1 Changed 15 years ago by Robert Corsaro

Resolution: fixed
Status: newclosed

(In [7141]) From header encoding canonized fixes #5679 Thanks ebray!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Robert Corsaro.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.