System.Net.Mail.MailMessage 和 Microsoft SMTP 服务器使用的 EML 文件格式
我正在尝试了解由 System.Net.Mail.MailMessage 生成并由 Microsoft 的 SMTP 服务器生成或使用的 EML 文件。我一直在阅读 RFC 5322 和 5321,并试图理解该格式。
诚然,我看到的大多数 EML 文件都遵循 5322(或 2322 或 822,但我不知道好的 MS 是否遵守标准)中描述的消息格式。但是,我无法完全确定文件的顶部部分(X-Sender 和 X-Receiver 行)是否构成 5321 所描述的“信封”。
我想我的问题是:
- 是否有这部分的文档包含 X-Sender/X-Receiver 行的文件(消息内容上方)?
- 本节中是否还有其他“命令”?
- 这是一个全面的“标准”吗?即我可以期望由 System.Net.Mail.MailMessage 生成的 EML 文件在任何标准 SMTP 服务器中都能正确解析吗?
I'm trying to wrap my head around the EML files I see generated by System.Net.Mail.MailMessage and generated or consumed by Microsoft's SMTP Server. I've been reading RFCs 5322 and 5321 and I'm trying to make sense of the format.
Granted, the majority of the EML files I see are adherent to the message format described in 5322 (or 2322 or 822, however good MS stuck to the standards, I don't know). However, I can't quite decide if the top portion of the file (the X-Sender and X-Receiver lines) constitute the "envelope" as described by 5321.
I guess my questions are:
- Is there documentation for the portion of this file with X-Sender/X-Receiver lines (above the message contents)?
- Are there other "commands" that can be expected in this section?
- Is this a "standard" across the board? i.e. can I expect an EML file that is generated by System.Net.Mail.MailMessage to be parsed correctly in any standard SMTP server?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,没有任何文档。这仅由 IIS SMTP 服务完成,据我所知,没有任何其他命令。
但是,电子邮件仍然符合 RFC2822。它只是在消息前面添加一些仍符合 RFC 标准但被 IIS SMTP 服务识别的 X 标头。
IIS SMTP 服务将使用 X-Sender 值作为 SMTP MAIL FROM 值,使用 X-Receiver 作为 RCPT TO 值。
No, there isn't any documentation. This is something only done by the IIS SMTP service, and there aren't any other commands that I'm aware of.
However, the email is still RFC2822 compliant. It just prepends the message with some X-Headers that are still RFC compliant, but are recognized the IIS SMTP service.
The IIS SMTP service will use the X-Sender value as the SMTP MAIL FROM value, and the X-Receiver as the RCPT TO value.