简体   繁体   English

回复后是否保留自定义邮件头?

[英]Are custom mail headers preserved after reply?

I'm currently trying to design a PHP webapp that allows users to send emails to other users. 我目前正在尝试设计一个允许用户向其他用户发送电子邮件的PHP webapp。 The recipient can then reply to the email and the message will be updated in the webapp. 然后,收件人可以回复该电子邮件,并且该消息将在webapp中更新。

Now to keep track of each individual user message, I would like to add a custom header (ie. conversation_id) in the email. 现在要跟踪每个用户的消息,我想在电子邮件中添加一个自定义标题(即conversation_id)。 When the recipient replies to the email in their email client, will the custom mail header (ie. conversation_id) be preserved? 当收件人回复其电子邮件客户端中的电子邮件时,是否会保留自定义邮件头(即conversation_id)?

There will be cron job that executes every minute that opens a POP3 stream to the web server to retrieve new emails (replies that the user may have sent with their mail client) to update my DB. 将会有每分钟执行一次cron作业,打开POP3流到Web服务器以检索新电子邮件(用户可能已使用其邮件客户端发送的回复)来更新我的数据库。

I'm not sure if this is a good way for designing such an app. 我不确定这是否是设计这样一个应用程序的好方法。 Any suggestions? 有什么建议么?

EDIT: Also, I'm sure wondering how I can strip out the quoted messages in the reply? 编辑:另外,我肯定想知道如何在回复中删除引用的消息?

You can't rely on mail headers being preserved - it is pretty much up to the individual mail client to decide what to include. 您不能依赖保留的邮件头 - 这取决于单个邮件客户端决定要包含的内容。

I would generally put the conversation ID within [] brackets in the subject which makes it really easy to parse out with a regular expression. 我通常会将对话ID放在主题的[]括号内,这样可以很容易地用正则表达式解析出来。

Each message already contains the Message-ID field which is used by the mail clients to create the content of the In-Reply-To field. 每条消息都已包含Message-ID字段,邮件客户端使用该字段创建In-Reply-To字段的内容。

Wouldn't the usual way after the standards be to rely on the user's mail client setting the in-reply-to field correctly? 在标准之后,通常的方式是依靠用户的邮件客户端正确设置回复字段吗? As far as I know, all email client use this correctly. 据我所知,所有电子邮件客户端都正确使用它。 (even though according to this thread Outlook may have an occasional bug?) (尽管根据这个帖子, Outlook可能偶尔出现错误?)

So I think, emails already feature this and you don't have to worry about creating a custom mail header entry and unpredictably behaving mail clients. 所以我认为,电子邮件已经具有此功能,您不必担心创建自定义邮件标头条目和不可预测的邮件客户端行为。

EDIT: I rembember a friend telling me his frustration from work about how many people remove or even edit these Tags in [ ] brackets from the suject field. 编辑:我记得一位朋友告诉我他的工作令人沮丧,有多少人从[]括号中删除甚至编辑这些标签。 Also, it seems to be a very dirty work-around and all of your software would need to handle it without opposing it to the users ability to change it => practically impossible. 此外,它似乎是一个非常肮脏的解决方案,您的所有软件都需要处理它而不反对用户更改它的能力=>几乎不可能。

EDIT: I think it will be hard to reliably strip out the quoted message in the reply, because each mail client handles it differently. 编辑:我认为很难在回复中可靠地删除引用的消息,因为每个邮件客户端处理它的方式不同。

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

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