Processing incoming emails

I’ve been looking into how to programatically process incoming emails. For example, to create an email address where somebody can send a CSV file and then have that data parsed and automatically inserted into a database.

There are some interesting tools in this space. The easiest, at least in principle, appears to be Email Yak. They expose a JSON API which will trigger a POST or GET request for incoming messages, and can send message likewise. However, upon signup I got a 500 error and likewise after logging in. So I can’t currently test the service. In principle though, it looks interesting. 500 emails a month on their domain for free, 1000 on any domain for $5/month. Then it kicks up to $40 or $150 for 20k or 100k emails.

Another interesting tool is Context.IO. This is essentially a web friendly API in front of IMAP mailboxes. Their pricing model is also interesting, starting at $1.50 per mailbox per month, with a $15 minimum. Currently the service is read-only, but the option to move messages around is coming in api v2. They also have a free account which includes 3 mailboxes, and they charge 85c/GB for attachment transfer over 100MB.

This is really about extracting knowledge from email inboxes and focuses Google’s mail hosting (gmail/google apps), but will work with others. There seems to be a strong focus on attachments and conversations. Could be a useful component in quickly building another service, but I’d guess I’d want to build my own version eventually.

Google App Engine provides a mechanism to handle incoming emails and pipe them to a script. Sounds very sensible, and it would probably be possible to build a mail routing system on top of this by having the python script send the mail onwards via an API call or POST request.

I also read a few articles about having postfix send mail to a script. This one is useful. This article talks about configuring custom reply-to addresses to know which emails bounce, something called VERP apparently.


It seems to me like Yak Mail (I’ve had a reply from them about the 500 error while typing this blog post, impressed!) and Context.IO are useful pieces. Google’s mail API is also smart, and Amazon will probably add something similar to AWS before too long. If this was core to an application, I’d probably set up postfix to forward mail to a script eventually. But in the early days, I think Yak Mail is probably the way to go.


In my roundup, appeared to have completely missed the best offering of all, mailgun. Free tier includes 200 messages a day on a shared IP, pro tier is $19 minimum per month on a shared ip, $59 minimum on a dedicated IP. APIs to send and receive mail, mailboxes accessible via IMAP and POP3, charges only for storage and message counts, not mailoxes. Plus open source helper libraries available. Looks like the slickest of the lot.

One thought on “Processing incoming emails”

Leave a Reply

Your email address will not be published. Required fields are marked *