开发者

How do I get the original sender from a forwarded email using Rails 3 mail gem?

I am trying to forward email into my Rails3/Ruby 1.9.2 app and I need to get the sender's email address.

Anyone k开发者_运维问答now how to do this with new Rails 3 mail?

Also can I get the time received or sent from the sender?


According to the docs here

You should just be able to call

mail.envelope_from


Normally the forwarding mail server will pass on the address it's forwarding for as a header. At CloudMailin we are experimenting with passing the header x-forwarded-for which google and some other servers add. It's not garaunteed but if your server sets a header and your only using one it will be consistent so you can rely on it being there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜