如何使用mailman处理电子邮件线程

时间:2012-02-17 14:40:46

标签: ruby-on-rails ruby gmail mailman

如果回复“故障单”的人正在使用Gmail等邮件客户端,那么当我执行@message.body.decoded而不是他们输入的文本时,回复将显示整个会话线程。

有没有办法只提取那部分文字?

1 个答案:

答案 0 :(得分:2)

通常,现有回复的格式为前一个>。一种选择是提取不以该字符开头的行。

因此,您将该电子邮件视为纯文本,您可以将其提取出来。这是一个例子:

--f46d0basically0a0unique0id # Marks the start of content for this email
Content-Type: text/plain; charset=ISO-8859-1

Hello foo,

This is a message.

Regards,
Bar

>
> Original response
> is quoted like this
> What in included here 
> depends on mail client
>


--f46d0basically0a0unique0id # Marks the end of content for this email