views:

598

answers:

3

For my side project kwiqi, I use ActionMailer's 'receive' method to process incoming email messages for tracking my expenses. Heroku doesn't have a local mail server running that same code will not work. One solution I've thought of is to periodically hit a controller action that will pull messages from Gmail. Are there other solutions that are reasonable? Is anyone processing incoming emails in Heroku?

+2  A: 

A real limitation of Heroku currently is that the most rapid frequency they support for cron jobs is hourly.

I'd recommend using Gmail and using delayed job as an alternative to cron to set a more reasonable frequency. There is a good tutorial on setting this up at WiseJive

Mike Buckbee
+3  A: 

Heroku support running workers using DelayedJob. Workers are resourced just like Dynos (you pay by the hour) and for this you get a dedicated resource to process your emails.

In the past I have used Cron calling a controller in my app. It's pretty effective.

If the hourly limitation is an issue, you can call your app from another location ... I have a cheap Dreamhost account for some of my non-priority sites that I have used as Cron systems.

There are also a number of ping and uptime services that you can use for this purpose as well ... simply pass these services your email controller.

Toby Hede
I figured as much. It's a personal project so there's no harm in tying up a dyno to do some processing.
Jerry Cheung
I like the idea of using a ping service to perform work.
David Medinets
+3  A: 

You can use sendgrid addon, and their parse api (http://wiki.sendgrid.com/doku.php?id=parse_api). I've written a short tutorial on how to do so here: http://nanceskitchen.com/2010/02/21/accept-incoming-emails-into-a-heroku-app-using-sendgrid/

DougB
Thanks for this, great tutorial. Did you end up having to pay for the SendGrid pro addon?
hornairs