pythonimaplibhttplib

httplib to connect to IMAP email server?


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.


Solution

  • 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: