thoughtbot/griddler

How can I parse only specific addresses with an inbound parse hook?

Closed this issue · 1 comments

I want my app to be forwarded emails sent to a specific email address, e.g. griddler@foobar.com; that is, if somebody sends email to support@foobar.com or webmaster@foobar.com, I still want to get that in my inbox. I would imagine this is a pretty common use case, right? But from what I'm hearing from SendGrid, that's not possible; I can forward all @foobar.com emails or none of them via the inbound parse webhook. So, that seems to leave me two options:

  1. Forward all @foobar.com emails to the app, and write my EmailProcessor to forward everything but the griddler@foobar.com emails on to their original recipients. That seems less than ideal.
  2. Forward only emails at a subdomain, like email@griddler.foobar.com. Anything at the top-level domain @foobar.com will still go to the inbox. The inbound parse webhook can be set up to do this, but I'm not wild about making my customers use the subdomain.

I can't find anything about this in the docs or elsewhere, which makes me think I'm missing something here. How do people handle this? Do other clients besides SendGrid allow forwarding only specific addresses?

I'm thinking you'd need to use your email provider to forward whatever emails you are targeting to SendGrid. You can setup the inbound parse to be griddler@parse.foobar.com and then use your provider to take any mail incoming to griddler@foobar.com and forward it to griddler@parse.foobar.com.