Email Forwarding like Craigslist - Rails

前端 未结 2 797
刺人心
刺人心 2020-12-28 10:14

I\'m trying to do what craigslist\'s anonymous email does, but with Rails, also on the cheap. It is important for me to be able to add a header to the email, which is why ba

2条回答
  •  遥遥无期
    2020-12-28 11:12

    If your app is going to scale, especailly across multiple servers then I wouldn't recomend the default Rails way of receiving email. Take a look at a blog post I wrote here about some options.

    The basic premise is that you want to receive mail on a catch all domain. You can either forward/collect using imap/pop3 from a server like gmail or use a service like CloudMailin to take care of delivering the message to your app. You can give each user a unique to address or even just use the disposable part of the message such as normal+disposable@domain.com.

    Then it's just a case of using the mail gem to inspect the message and add any headers that you need to and send the message on again. Again you can use your own email server to do this delivery or rely on a service like Amazon's Simple Email Service if you want to improve your deliverability.

提交回复
热议问题