Will an MX record "follow" a CNAME record?

I have a situation I'm trying to work through that I'm not entirely sure how to solve.

Here's the situation:

I have a domain, let's say sub.otherdomain.com, that I want to set up e-mail addresses on, and additionally set up an A record on. I don't own this domain, but the owners of the domain have set up a CNAME record to point to one of my domains (let's say customer.mydomain.com)

My understanding is that setting up a CNAME record will cause all record lookups for sub.otherdomain.com to use the records defined on customer.mydomain.com. This seems to work fine for the A record I have set up, but the MX records don't seem to be passing through the CNAME correctly.

In summary, the following records exist:

sub.otherdomain.com

CNAME  customer.mydomain.com

customer.mydomain.com

A xxx.xxx.xxx.xxx
MX (mx details)

My assumption is that e-mails sent to [email protected] would use the MX records from customer.mydomain.com. Is this not the case?


Check out http://www.ietf.org/rfc/rfc1123.txt

The domain names that a Sender-SMTP sends in MAIL and RCPT commands MUST have been "canonicalized," i.e., they must be fully-qualified principal names or domain literals, not nicknames or domain abbreviations. A canonicalized name either identifies a host directly or is an MX name; it cannot be a CNAME.


Yes, this should work. From RFC 5321:

Only resolvable, fully-qualified domain names (FQDNs) are permitted when domain names are used in SMTP. In other words, names that can be resolved to MX RRs or address (i.e., A or AAAA) RRs (as discussed in Section 5) are permitted, as are CNAME RRs whose targets can be resolved, in turn, to MX or address RRs.

and:

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.