rtucker/imap2maildir — Issue #18: TypeError in parseFetch
Author: adrianratnapala
Created: 2011-12-25 03:29:18+00:00
State: open

Trying when imap2maildir for the first time, I find it first downloads many (perhaps all) all of the messages and then crashes. If I repeat it, then it crashes immediately (although if new messages have appeared in the meantime it might download them, I haven't checked). (I am running commit 9d8a6efd3, under Python v 2.7.2, on Ubuntu 11.10, the connection is IMAP over SSL).

I'd send a more complete log and a stack trace if I knew where to post it, but in short, the problem is that the "text" parameter to __simplebase.parseFetch is a tuple rather than a string. the value is:

text[0] == '182 (UID 183 RFC822.SIZE 3297 INTERNALDATE "08-Dec-2011 16:40:03 +0100" ENVELOPE ("Thu, 8 Dec 2011 16:40:03 +0100" {79}'

text[1] == (the subject line of one of my emails)

This tuple is the first "data" element returned from the FETCH command in get_summary_by_uid is not as expected. My reading of the imaplib documentation makes me expect a tuple in this situation (although unbalanced parentheses in text[0] surprise me).

Finally I can't get away simple tricks like, sending data[0][0] or ' '.join(data[0]) to parseFetch -- there seems to be some nontrivial change in format. My imaplib.py says it's version is 2.58

Cheers.