Quote:
|
Originally Posted by marcmac The above post is missing the MX record, which is key for this issue - also, it's considered a good idea to have the name for your MX host be an A record, not a CNAME record (though I don't remember why). |
Oops, good catch. That's been corrected.
Now, I think the way most MTA's work is that they first look up the DNS MX record, and failing that, search for an A record. So, what was in there would likely have worked. However, it increases the amount of DNS queries necessary to deliver an email to that domain, which isn't what we want :-)
Regarding one not using a CNAME for an MX record... I ran across that in an RFC somewhere after having tried it with occasional odd results :-) Some MTA's rebel, and instead of delivering the email to the CNAME listed in the MX record, they resolve the A record for that IP address. So, it generally ends up working, but can have some really unexpected results if you aren't looking for it... for example, I saw that occur on a mailing list. The list was setup to receive mail at the domain stuff.mylist.com... which the name was really CNAME for other.domain.com.
So, the emails arrived, but some MTA's rewrote the To: address to be the A record, other.domain.com. Since the mailing list software was prepared to receive emails for stuff.mylist.com, it ignored the emails. It took some time to figure that out :-)
SMTP RFC:
http://www.ietf.org/rfc/rfc2821.txt
"The lookup first attempts to locate an MX record associated with the name. If a CNAME record is found instead, the resulting name is processed as if it were the initial name."
So yeah, if you use a CNAME, it's going to deliver to the resulting A record. And MTA's like sendmail go so far as to rewrite the To: address to match this. So, yeah, bad :-)
-Eric