imaplib and fetch results

Harald Terkelsen Harald.Terkelsen at adm.hioslo.no
Thu Jan 27 11:22:29 EST 2000


I've been playing with the imaplib.py module and found some difference
in the returned data of the fetch function depending on the
message_part argument.

The command:

typ, data = M.FETCH('13:17', '(FLAGS envelope)')

returns a list where data[0] is the flags and envelope data from
message 13, data[1] for message 14 and so on. This is what i would
expect.

But the result of the following command is somewhat different:

typ, data = M.FETCH('13:17', '(FLAGS body.peek[header.fields (From Subject)])')

Now data[0] contains the information from message 13 as in the previous
fetch command. I would then assume data[1] to contain the requested
information for message 14, but it doesn't. Instead data[1] contains
the character ')'. data[2] contains the data for message 14 and
data[3] gives me again an ')' and so on.

Does anybody know why it is like this, or is it a bug?

Harald







More information about the Python-list mailing list