正确发送邮件列表邮件的电子邮件标题 [英] Correct email headers for delivering mailing list mail

查看:44
本文介绍了正确发送邮件列表邮件的电子邮件标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个允许用户向动态创建的邮件列表发送电子邮件的应用程序.例如,用户可以向 my-team@site.com 发送电子邮件(该站点是体育联赛的联赛管理站点),电子邮件将发送给该​​用户团队中的每个人.我试图弄清楚电子邮件标题应该是什么才能正确发送电子邮件并使所有 From 和 To 字段看起来正确.

I'm writing an application that allows users to send email to dynamically-created mailing lists. For example, a user can send an email to my-team@site.com (the site is a league management site for sports leagues) and the email will be sent to everyone on that users's team. I'm trying to figure out what the email headers should be to deliver the email correctly and make all the From and To fields look right.

在 Gmail 中,当您收到来自邮件列表的电子邮件(我正在查看来自 google 群组的电子邮件)时,它说它来自发送它的人并且它已发送到列表地址,但是电子邮件已发送给我.除了 Delivered-To: 标头之外,我的地址不会出现在任何标头中.这是谷歌的魔法吗,还是我可以做同样的事情?

In Gmail, when you get an email from a mailing list (I'm looking at an email from google groups), it says that it came from the person who sent it and that it was sent to the list address, yet the email was delivered to me. My address doesn't appear in any of headers except in the Delivered-To: header. Is that some Google magic, or can I do the same thing?

额外问题:我正在使用 Postfix+OpenDKIM 对电子邮件进行签名.如果 From 域与我指定的域匹配,它将对消息进行签名,但如果 Sender 域匹配,则不会.我怎样才能告诉它使用发件人域.

Bonus question: I'm using Postfix+OpenDKIM to sign the emails. It will sign the message if the From domain matches the one I specified, but not if the Sender domain matches. How can I tell it to use the Sender domain instead.

推荐答案

From: 和 To: 标头用于显示目的"(这是在用户电子邮件应用程序中作为发件人和收件人呈现的内容).它们不必与称为信封发件人"/信封收件人"并在 smtp 协议中指定的电子邮件消息的真实发件人/收件人相匹配(MAIL FROM:...."RCPT TO...").

From: and To: headers are for 'display purposes' (this is what is presented in the users email application as sender and recipient). They don't have to match to the real sender/recipient of a email message which are called "envelope sender"/"envelope recipient" and are specified in the smtp protocol ("MAIL FROM:...." "RCPT TO...").

示例:

邮件来自 alice@example.com,发送到 list@example.org 并正在发送到 bob@example.net:

Mail comes from alice@example.com, goes to list@example.org and is being delivered to bob@example.net:

从 Alice 到列表服务器:

信封发件人:alice@example.com
信封收件人:list@example.org
来自 标题:alice@example.com
收件人 标题:list@example.org

Envelope Sender: alice@example.com
Envelope Recipient: list@example.org
From Header: alice@example.com
To Header: list@example.org

从列表服务器到 bob:

信封发件人:list-bounces@example.org(因此错误消息会发送到列表服务器,而不是发送给 alice!)
信封收件人:bob@example.net
From 标头:alice@example.com(Bob 将 Alice 视为发件人,列表服务器不会修改)
标题:list@example.org(同样,未被列表服务器修改)

Envelope Sender: list-bounces@example.org (so error messages go to the list server, not to alice!)
Envelope Recipient: bob@example.net
From Header: alice@example.com (Bob sees Alice as the sender, this is not modified by the list server)
To Header: list@example.org (again, not modified by the list server)

可选:Reply-To 标头:list@example.org(因此,如果 bob 按下回复,回复将发送到列表 - 由列表服务器添加) - 注意:有些人不喜欢 回复邮件头处理

Optional: Reply-To header: list@example.org (So, if bob presses reply, the reply goes to the list - added by the list server ) - beware: some people do not like reply-to header munging

其他标题:

一些电子邮件客户端也理解这些额外的标题并向用户提供特殊的邮件列表功能:

Some email clients also understand these additional headers and present special mailinglist features to the user:

  • list-Id
  • 列表发布
  • 列表帮助
  • 取消订阅
  • 列表所有者

https://www.ietf.org/rfc/rfc2919.txthttps://www.ietf.org/rfc/rfc2369.txt

另外,你可以添加一个标题

Also, you could add a header

Precedence: bulk

例如,它告诉智能外出实施不要向列表发送外出回复.但 RFC 2076 不鼓励这样做.

which for example tells intelligent out-of-office implementations not to send out-of-office replies to the list. But this is discouraged by RFC 2076.

这篇关于正确发送邮件列表邮件的电子邮件标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆