I'm curious, can the httplib be jury rigged to connect to an IMAP email server?
I'm being forced to python connect to an IMAP server without using IMAPlib and while I've learned a lot about sockets and IMAP, I'm frankly growing tired of the exercise and this workaround would be totally awesome.
If it's not easily possible, I understand and accept that as a legitimate answer.
Sorry, but I don't think so. At least, if you manage to do it somehow, it won't be any easier than implementing IMAP over raw sockets yourself. HTTP and IMAP are very different protocols, and a library specialized in speaking one language will have a hard time communicating in the other one.
I don't really know about your objective and what you're allowed to use and why (Now really, why can't you use imaplib?), but let's look at a few options here:
imaplib
with spending much more time/work/money (again, who would forbid you from using a ready-to-use IMAP library if you want t oaccess IMAP? Is this some kind of trick?).mbox
or Maildir
format. Both are tried, tested and well-defined, and reading out some files will probably be easier than full-on IMAP access. (If you're lucky, you might even be able to use some module to read those formats.) Update: Oh, here, look at Python's mailbox module. Can you use that?