Sender、From 和 Return-Path 有什么区别? [英] What's the difference between Sender, From and Return-Path?

查看:29
本文介绍了Sender、From 和 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屋!

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