In DNS, I have service.example.com. CNAME box.example.com. When sending email automatically to about 10,000 adresses (no worries, nothing sinister), I set envelope-from to something@service.example.com. Of the bounces that come back, about 70% have envelope-to set to something@service.example.com (which is what I would expect), but about 30% have envelope-to to something@box.example.com.

What is going on here? Do some MTAs change envelope-to when they discover a CNAME? Which MTAs?

Is it a good idea to use an A record instead of a CNAME for service.example.com.?


Yes, some MTA rewrite addresses, usually sendmail with custom macros that are trying to consolidate multiple internal (formerly external) domains into one consistent external domain.

Your bounce percentages might also be explained by the level at which the bounce came back. For example, a bounce from your edge MTA might well look different than a bounce from someone else's MTA.


I cannot speak for the exact performance in your situation due to lack of details.

The Return-Path: header is specified by the MDA, which uses the address identified in the MAIL FROM command.

The MTA typically defaults the MAIL FROM as the user sending the mail. For example, calling qmail-inject with the -f flag can change the Return-Path to the specified e-Mail address.

For example, my username is warner on the awesomebox(.awesomedomain.org) server. If I send an e-Mail using mutt and specify the From: header as warner@awesomedomain.org, the MTA (QMAIL) is going to default to specifying the MAIL FROM as warner@awesomebox.awesomedomain.org.

The same performance would apply to CGI running via Apache, it would default the Return-Path to the user Apache runs as.


According to RFC 1123 your MX record must point to a hostname with an A record (and/or AAAA for IPv6), and never to one with a CNAME!

  • There is no MX record involved here, only a CNAME (service.example.com) pointing to an A record (box.example.com). – Vebjorn Ljosa Aug 24 '10 at 19:48
  • Well, you must have an MX record. There is an old RFC that states that in absence of an MX record the A record should be used instead, but that was only meant as a temporary fallback until all admins had implemented the MX record, and in both cases it specifically asks for a canonical hostname (so no CNAME). (Some anti-spam systems probably give mail from your server a negative marking for the fact that you don't have an MX record, and a second one for only having a CNAME...) – JanC Aug 25 '10 at 0:17
  • So to answer your question: make an MX record that points to a hostname with an A record. The hostname can be whatever mailserver you want to use to receive mail for @service.example.com (and of course, the mailserver must also be configured to accept mail for that domain). – JanC Aug 25 '10 at 0:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.