简体   繁体   English

使用ruby确定是否转发了收到的电子邮件

[英]Determine if a received email was forwarded, using ruby

Imagine that you receive and parse an email using the ruby Mail gem . 想象一下,您使用ruby Mail gem接收并解析了一封电子邮件。 I need to be able to determine if the email has been forwarded, and extract the original sender and message. 我需要能够确定电子邮件是否已转发,并提取原始发件人和邮件。 By this I mean forwarded as in a user somewhere has clicked the "Forward" button in their email client or webmail interface. 所谓“转发”,是指用户在某处单击电子邮件客户端或Webmail界面中的“转发”按钮。

I guess my questions are: 我想我的问题是:

  1. Are there are any concrete rules for what email clients should do to a forwarded message? 电子邮件客户端应如何处理转发的消息,是否有任何具体规则?
  2. If so, where can I find them? 如果是这样,我在哪里可以找到它们?
  3. If not, would anyone like to volunteer to forward me some example emails from various different email clients so that I can build a reliable forwarded email detector and parser (the examples would be anonymized and the detector/parser will be open-sourced as a ruby gem on GitHub)? 如果不是这样,有人愿意自愿转发一些来自不同电子邮件客户端的示例电子邮件,以便我可以构建可靠的转发电子邮件检测器和解析器(示例将被匿名化,检测器/解析器将作为红宝石开源。 GitHub上的gem)?

Cheers! 干杯!

  1. Yes, they should attach the forwarded email or include it on the body 是的,他们应该附加转发的电子邮件或将其包含在正文中
  2. You need to parse yourself the emails and try to detect that. 您需要分析自己的电子邮件,然后尝试进行检测。
  3. I don't have this ... sorry! 我没有这个...抱歉!

Each email client can do whatever they want. 每个电子邮件客户端可以做他们想做的任何事情。 So even if you create a detector/parsaer today, tomorrow with a new version of outlook/thunderbird probably it will not match. 因此,即使您今天创建了一个探测器/ parsaer,明天使用新版本的Outlook / Thunderbird可能也不会匹配。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM