Yeah, this behavior is wrong.. but enforcing RFC standards in SMTP is hopeless. To quote 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.
But, the sendmail MTA rewrites the recipient address by default, in violation of the RFC. The
nocanonify feature, or the
DontExpandCnames option, fix this.. but when you don't have control over the server that's messing with things, all you can do is work around it.
The RFC's phrasing was originally in RFC 2821, from 2001, but hilariously, the current sendmail documentation on
DontExpandCnames to this day says, 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.