不会被剥离的客户电子邮件标头

发布于 2024-10-21 14:09:04 字数 217 浏览 4 评论 0原文

我们需要在电子邮件中传递一些可用于跟踪和关联的数据,我们正在考虑在主题/正文中使用自定义标头或令牌。

有谁知道可以使用且不会被电子邮件服务器删除的电子邮件标头?我知道您可以添加 X- 标头来指定自定义内容,但似乎您永远无法确定它们不会在服务器剥离它们或在转发电子邮件时被删除时幸存下来。

令牌选项似乎也不理想,因为它很容易被用户删除,还有其他更好的技术吗?

感谢您抽出时间

We need to pass some data in emails that can be used for tracking and correlation, we were looking at using a custom header or a token in the subject/body.

Does anyone know of an email header that can be used that will not be removed by email servers? I know you can add X- headers to specify custom content but it seems you can never be sure they won't survive either the server stripping them or being removed when the email is forwarded.

The token option also doesn't seem ideal as it can easily be removed by the user, are there any other better techniques?

Thanks for your time

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

妄司 2024-10-28 14:09:04

服务器不应该剥离 X- 标头(只要它们格式正确),除非您碰巧为服务器为自己的目的使用的 X- 标头选择了一个名称。但是没有任何标头不能被服务器或用户删除或更改。正确的转发操作应该保留标头,而不正确的转发不能保证保留任何标头。

标头可能是最好的方法,因为大多数用户不会意识到除了“From”、“To”和“Subject”之外的标头的存在,而且因为这确实是此类元数据的位置。在 Message-Id 标头中对其进行编码可能比在 X- 标头中进行编码更加稳健。或者,如果它很短,您可以在主题行中将其编码为“票号”等。

A server should not be stripping X- headers (as long as they are correctly formatted, anyway), unless perhaps you happen to pick a name for that X- header that the server uses for its own purposes. But there is no header that cannot be stripped or altered by a server or user. A proper forward operation should preserve the headers, and an improper forward isn't guaranteed to retain any headers.

A header is probably the best method, both because most users won't be aware that headers besides "From", "To", and "Subject" even exist and because that's really the place for such metadata. Encoding it in the Message-Id header might be slightly more robust than in an X- header. Or if it's very short, you could encode it in the subject line as a "ticket number" or the like.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文