我发现远程站点正在重写用于我们机器的电子邮件,以使用邮件发往的机器的CName(例如mail@virtual.virtualdomain.com成为mail@cname.maindomain.com).这是正确的行为吗?
解决方法
是的,这种行为是错误的..但在SMTP中强制执行RFC标准是没有希望的.引用
RFC 5321:
The lookup first attempts to locate an MX record associated with the name. If a CNAME record is found,the resulting name is processed as if it were the initial name.
但是,默认情况下,sendmail MTA会重写收件人地址,这违反了RFC. nocanonify功能或DontExpandCnames选项可以解决这个问题.但是当你无法控制那些搞乱事情的服务器时,你所能做的就是解决它.
RFC的措辞最初是在2001年的RFC 2821,但很有趣,目前关于DontExpandCnames的sendmail文档至今为止,quote:
If set,$[ … $] lookups that do DNS based lookups do not expand CNAME records. This currently violates the published standards,but the IETF seems to be moving toward legalizing this.