Modify

Opened 5 years ago

Closed 5 years ago

#5679 closed defect (fixed)

From header encoded incorrectly

Reported by: ebray Owned by: doki_pen
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 5 years ago by doki_pen

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

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

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from doki_pen. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.