Edgewall Software

Ticket #2014: ugly-notify.patch

File ugly-notify.patch, 1.1 KB (added by polarfox@…, 7 years ago)

add's some glue to eblot's patch that makes things work. ugly patch, but works for me.

  • Notify.py

    old new  
    172172        msg = MIMEText(body, 'plain', 'utf-8') 
    173173        self.add_headers(msg, headers); 
    174174        self.add_headers(msg, mime_headers); 
    175  
    176         self.env.log.debug("Sending SMTP notification to %s on port %d" 
    177                            % (self.smtp_server, self.smtp_port)) 
     175        if msg.__contains__('MIME-Version'): 
     176            msg.__delitem__('MIME-Version') 
     177        if msg.__contains__('Content-Transfer-Encoding'): 
     178            msg.__delitem__('Content-Transfer-Encoding') 
     179        if msg.__contains__('Content-Type'): 
     180            msg.__delitem__('Content-Type') 
     181        msg['MIME-Version']=unicode('1.0','ascii') 
     182        msg['Content-Transfer-Encoding']=unicode('Base64','ascii') 
     183        msg['Content-Type']=unicode('text/plain','ascii') 
     184        self.env.log.debug("Sending SMTP notification to %s:%d content:\n%s" 
     185                           % (self.smtp_server, self.smtp_port,msg.as_string())) 
    178186        self.server.sendmail(self.from_email, [rcpt], msg.as_string()) 
    179187 
    180188    def finish_send(self):