diff roundup/mailgw.py @ 1712:f686c73fc5d1

The .replace in getheader would fail for absent headers (that return None).
author Jean Jordaan <neaj@users.sourceforge.net>
date Wed, 25 Jun 2003 08:02:51 +0000
parents 3c3e44aacdb4
children e5a17d4dd2c2 8d3182e78ebc
line wrap: on
line diff
--- a/roundup/mailgw.py	Tue Jun 24 12:39:20 2003 +0000
+++ b/roundup/mailgw.py	Wed Jun 25 08:02:51 2003 +0000
@@ -73,7 +73,7 @@
 an exception, the original message is bounced back to the sender with the
 explanatory message given in the exception. 
 
-$Id: mailgw.py,v 1.125 2003-06-24 12:39:20 neaj Exp $
+$Id: mailgw.py,v 1.126 2003-06-25 08:02:51 neaj Exp $
 '''
 
 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
@@ -186,7 +186,8 @@
 
     def getheader(self, name, default=None):
         hdr = mimetools.Message.getheader(self, name, default)
-        hdr = hdr.replace('\n','') # Inserted by rfc822.readheaders
+        if hdr:
+            hdr = hdr.replace('\n','') # Inserted by rfc822.readheaders
         return rfc2822.decode_header(hdr)
  
 class MailGW:

Roundup Issue Tracker: http://roundup-tracker.org/