Permalink
Browse files

imapflag: handle long subjects spanning multiple lines

  • Loading branch information...
1 parent 13d9534 commit d32ea69e99d84113c52e7579a0b0cb1e31f920ea @dnet committed Jan 30, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 imapflag.py
View
@@ -65,7 +65,7 @@ def connectImap(self):
def processMessage(self, msg_id):
_, data = self.imap.fetch(msg_id, '(BODY[HEADER.FIELDS (DATE FROM SUBJECT)])')
datestr, fromstr, subjectstr = sorted(ifilter(None,
- data[0][1].replace('\r', '').split('\n')))
+ data[0][1].replace('\r', '').replace('\n ', ' ').split('\n')))
date = datetime.fromtimestamp(mktime_tz(parsedate_tz(datestr[6:])))
subject = unicode_header(subjectstr)
fromaddr = unicode_header(fromstr)

0 comments on commit d32ea69

Please sign in to comment.