Sender、From 和 Return-Path 之间有什么区别? [英] What's the difference between Sender, From and Return-Path?
问题描述
电子邮件发件人、发件人和返回路径值之间有什么区别?
What's the difference between an email Sender, From and Return-Path value?
示例:我有一个联系表单,用户可以在其中输入他们的电子邮件,这会分配给发件人、发件人还是返回路径?
Example: I have a contact form where the user can input their email, would this be assigned to sender, from or return-path?
我在 StackOverflow 上进行了快速搜索,但没有找到任何有用的信息.
I had a quick search on the StackOverflow and couldn't find anything useful.
推荐答案
因此,通过 SMTP 提交邮件时,SMTP 信封(发件人、收件人等)与邮件的实际数据不同.
So, over SMTP when a message is submitted, the SMTP envelope (sender, recipients, etc.) is different from the actual data of the message.
Sender
标头用于在邮件中标识提交者.这通常与 From
标头相同,即消息的来源.但是,在邮件代理代表其他人发送邮件的某些情况下,情况可能会有所不同.
The Sender
header is used to identify in the message who submitted it. This is usually the same as the From
header, which is who the message is from. However, it can differ in some cases where a mail agent is sending messages on behalf of someone else.
Return-Path
标头用于向收件人(或接收 MTA)指示未送达回执将发送到何处.
The Return-Path
header is used to indicate to the recipient (or receiving MTA) where non-delivery receipts are to be sent.
以允许用户从网页发送邮件的服务器为例.因此,sender@yourcompany.com
输入消息并提交.然后,服务器将消息发送给其收件人,并将 From
设置为 sender@yourcompany.com
.实际的 SMTP 提交使用不同的凭据,例如 mailagent@mywebmail.com
.因此,sender
标头设置为 mailagent@mywebmail.com
,以表明 From
标头并不表明谁实际提交了邮件.
For example, take a server that allows users to send mail from a web page. So, sender@yourcompany.com
types in a message and submits it. The server then sends the message to its recipient with From
set to sender@yourcompany.com
. The actual SMTP submission uses different credentials, something like mailagent@mywebmail.com
. So, the sender
header is set to mailagent@mywebmail.com
, to indicate the From
header doesn't indicate who actually submitted the message.
在这种情况下,如果邮件无法发送,代理收到未送达报告可能会更好,因此Return-Path
也将设置为mailagent@mywebmail.com
以便将任何送达报告发送给它而不是发件人.
In this case, if the message cannot be sent, it's probably better for the agent to receive the non-delivery report, and so Return-Path
would also be set to mailagent@mywebmail.com
so that any delivery reports go to it instead of the sender.
如果您只是这样做,提交表单以发送电子邮件,那么这可能与您设置标题的方式直接平行.
If you are doing just that, a form submission to send e-mail, then this is probably a direct parallel with how you'd set the headers.
这篇关于Sender、From 和 Return-Path 之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!