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:
- You could implement IMAP by hand over raw sockets or whatever you're allowed to use. At best, you'll end up with something like Python's
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?). - You could try and access the Email via POP,which I personally find a lot easier than IMAP. Actually, easy enough to speak to a mail server in person without a program in between. It's not as cool as IMAP, but if you just need to fetch mail, it's less work.
- There are some excellent console email clients which speak IMAP. Mutt comes to mind, but that might not be your best choice (don't know, check out what options are available). They usually save emails in
mbox
orMaildir
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?