发送者、发件人和回邮地址之间有什么区别?
示例:我有一个联系表单,用户可以输入他们的电子邮件地址,这个地址应该被分配给发送者、发件人还是回邮地址?
我在StackOverflow上进行了快速搜索,但没有找到任何有用的信息。
因此,在SMTP中提交消息时,SMTP信封(发件人,收件人等)与消息的实际数据不同。
Sender
头部用于标识提交消息的人。这通常与From
头部相同,后者是消息的发送者。但在某些情况下,它可能会有所不同,例如邮件代理为其他人发送邮件的情况。
Return-Path
头部用于指示收件人(或接收MTA)应将非投递回执发送到哪里。
例如,假设有一个服务器允许用户从网页发送邮件。那么,sender@yourcompany.com
输入一条消息并提交。然后,服务器使用From
设置为sender@yourcompany.com
将该消息发送给其收件人。实际的SMTP提交使用不同的凭据,类似于mailagent@mywebmail.com
。因此,将sender
头部设置为mailagent@mywebmail.com
以指示From
头部并未指示实际提交消息的人。
在这种情况下,如果无法发送消息,则最好为代理收到非投递报告,因此Return-Path
也将设置为mailagent@mywebmail.com
,以便任何投递报告发送给代理而不是发件人。
如果您正在执行此操作,即提交表单以发送电子邮件,则这与如何设置标头可能是直接并行的。
这个规范的官方RFC可以在这里找到:
https://www.rfc-editor.org/rfc/rfc4021#section-2.1.2 (请查看第2.1.2段及其后面的内容)
2.1.2. Header Field: From
Description: Mailbox of message author [...] Related information: Specifies the author(s) of the message; that is, the mailbox(es) of the person(s) or system(s) responsible for the writing of the message. Defined as standard by RFC 822.
2.1.3. Header Field: Sender
Description: Mailbox of message sender [...] Related information: Specifies the mailbox of the agent responsible for the actual transmission of the message. Defined as standard by RFC 822.
2.1.22. Header Field: Return-Path
Description: Message return path [...] Related information: Return path for message response diagnostics. See also RFC 2821 [17]. Defined as standard by RFC 822.
Return-Path:
头部反映了信封发件人或 RFC5321.From 地址。From:
头部反映了头部发件人或 RFC5322.From 地址。 - cmeid