My app creates a unique email for each user, and users send email to that address for processing. Using Sendgrid, I've piped incoming emails to my domain (hosted on Heroku) to an address:
site.com/receive_email
I use the TO field to determine the user, since the email address is randomly generated.
I've experimented using an external script like Mailman, but since I'm hosted on Heroku I'd need to have a worker running full time to keep this process going. Not really looking for that at the moment for this test app.
That leaves processing it as a POST request. I have access to POST hash (params["subject"], etc.) at receive_emails.
This is where I get stuck
Would you suggest to deal with raw data from the POST params, or can I use something like Mailman or ActionMailer to process the email for me?
I haven't used Sendgrid to turn emails into post requests, but it works fine with cloudmailin, a heroku addon. Here is an example where someone sends an email to your application, it is processed by cloudmailin/sendgrid and turned into a post, and then sends it to your controller, and then the controller looks through the message params, finds the sender from the email address, and if the sender doesn't already exist, creates an account for her:
Good luck.