Index: roundup/mailgw.py =================================================================== RCS file: /cvsroot/roundup/roundup/roundup/mailgw.py,v retrieving revision 1.52 diff -c -r1.52 mailgw.py *** roundup/mailgw.py 2002/01/15 00:12:40 1.52 --- roundup/mailgw.py 2002/01/16 09:00:09 *************** *** 116,121 **** --- 116,137 ---- s.seek(0) return Message(s) + def getheader(self, name, default=None): + ''' Like the normal mimetools.Message.getheader(), but is guaranteed to + return the value without line breaks + ''' + value = mimetools.Message.getheader( self, name, default ) + + # okay, this looks messy - however, I'd really like to catch all four different + # ways of line continuation, because I don't know for sure whether \r is + # removed and the character after the line break in a test mail was a \t, + # but was replaced by a space when returned by getheader() + if value: + value = string.replace( string.replace( string.replace( string.replace( + value, '\n\t', '' ), '\n\r\t', '' ), '\n ', '' ), '\n\r ', '' ) + return value + + subject_re = re.compile(r'(?P\s*\W?\s*(fwd|re)\s*\W?\s*)*' r'\s*(\[(?P[^\d\s]+)(?P\d+)?\])' r'\s*(?P[^[]+)?(\[(?P<args>.+?)\])?', re.I)