I imaplib reliable?

Donn Cave donn at drizzle.com
Tue Mar 26 16:28:47 CET 2002

Quoth "Roger Binns" <rogerb at rogerbinns.com>:
| > I'm just not sure if Python's imaplib has been war tested.
| When I last tried it about 6 months ago, I found it to be full of
| problems.  In particular it pretty much just returned raw IMAP
| protocol strings for most operations.  The user of the library
| then has to do far too much parsing work.

Pardon me if I'm a little defensive of people who have contributed
useful software to the python library.  "Full of problems" is not
"doesn't do everything I hoped it would."  imaplib basically handles
IMAP4 as a network protocol.  Everyone who has used it will agree
that there's a lot of work left to the user.  But that's arguably
the only way to go.

Should imaplib parse everything?  Well, that would be nice, maybe,
but into what kind of structure?  If I set out to do that, I'd
probably use MxTextTools and return that kind of result - ever
seen what that looks like?  Others would probably prefer a parser
that performs user-supplied actions as it parses the input.  The
difference is significant.  The amount of work necessary to do
either one right is fairly substantial, and probably requires a
C module (like MxTextTools) if it's to be done efficiently, and
yet whatever you do, it's highly likely it will work out best for
you and not so well for anyone else, because we're fairly deep in
the application specific area at this point.  I'm not saying it
wouldn't be a great idea for someone to take this on, but it's
totally unfair to dismiss imaplib as "full of problems" because
it doesn't do it.

	Donn Cave, donn at drizzle.com

More information about the Python-list mailing list