Hacker News new | ask | show | jobs
by Maascamp 4957 days ago
In terms of managing IMAP connections, async is definitely the way to go. For our product, lightermail.com, I ported Python's imaplib to run on Tornado's ioloop (adding a few features like IDLE support and command pipelining). Not only can you manage a lot of connections with little memory, but you can do some really cool things (like the pipelining of commands mentioned above) that are unavailable to regular synchronous IMAP clients. Plan to open source the implementation when I have a bit more time.
2 comments

This is awesome! Please do open source it! I looked into doing this once before for ioloop, but ended up implementing IDLE with Twisted's twisted.mail.imap4.IMAP4Client instead. The results were fairly good, but I don't think it was worth the trouble finding the right timeouts, etc.

Also, not sure if it makes sense for your use case, but I considered moving to Postmark's Inbound API (http://postmarkapp.com/inbound). May work well for some people.

Sounds awesome. Just yesterday I was trying to hack pipelining support into imaplib, ultimately for use with Tornado. I'd be very interested in your implementation.
Thanks! I'll be sure to make a show HN or something when I do. I still need to add in support for compression, but it's not high on my todo list and I'm sure the community could help.