Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Ubuntu server, running sendmail (until this morning it was running postfix, but I moved to sendmail to eliminate the possibility of my postfix configuration tweaks being the cause of this issue). Up until a few weeks ago, this server was the sole mail server for my domain - and until I moved mail away from this box, email worked as expected, was delivered to the local users and was sent fine - but since moving it away, every time an email is sent through the MTA on this box it attempts to send it to the A record for my domain, rather than the MX records...which doesn't work very well as I use a CDN, and the CDN aren't hosting my mail funnily enough. From everywhere else to my domain is fine, and from that server sending to other domains is fine. If you perform a dig or an nslookup from the problem server the records appear correct, so after battling with this for nearly a week I'm stumped. Any help would be appreciated!

EDIT: DNS records for domain; CNAME to A to
MX priority 10
MX priority 20

the server with issues is


share|improve this question
Was there some reason why you moved to sendmail from postfix? Your problem sounds like a configuration problem with sendmail. Did you read through the sendmail configuration documentation? – douggro May 8 '13 at 14:51
I moved because postfix was giving the exact same issue - I thought it could be an issue with my configuration as I'd done some tweaking back when I started using it as a mail server, so removed postfix and added sendmail with clean configuration in the hope it would eliminate a configuration issue. – elliotberg May 8 '13 at 14:56
Please edit your post to include the DNS records for your domain (you can obfuscate domains/IP addresses in the listing). Are you running internal DNS service? After reviewing your question, it appears that your MUA's are not resolving the MTA's properly. Internally, sendmail or postfix will not care about DNS MX records - but MUA's connecting to either system need to resolve to the MTA designated in their SMTP Server settings. – douggro May 8 '13 at 16:19
About the move to sendmail: I have yet to see a situation where sendmail is easier to handle than postfix (regarding configuration). – guntbert May 8 '13 at 21:17
@douggro just added the DNS records I presume you need (there are tons on the domain, so I didn't add them all) - is there anything else you need? Also, for the record I far preferred postfix - I only switched in an attempt to fix this issue. Will gladly reinstall postfix when I get around to it, now knowing that it wasn't the cause of the issue. – elliotberg May 9 '13 at 16:03
up vote 1 down vote accepted

Sendmail converts CNAME (DNS alias) to real name. ->

Remove the CNAME OR add MX records for

share|improve this answer
Ah, that would make sense. If I removed the CNAME, but then added an explicit A record going to the same IP would that be fine do you think? I will try it, but wanted to ask as obviously it could be a while before DNS propagates! – elliotberg May 10 '13 at 7:11
Using A instead of CNAME would be better from email perspective. You can make your sendmail ignore CNAME but there are so many other sendmails on the Internet. – Andrzej A. Filip May 10 '13 at 7:18
OK - just changed that over then, let's see what happens! :) – elliotberg May 10 '13 at 7:27
That fixed it. Also, switched back to postfix rather than sendmail because I actually know how to configure it ;) Thanks! – elliotberg May 10 '13 at 10:05

If you are running multiple email servers - which your description sounds like you are - each server must have an A record. You can then add a CNAME record for each server to match the MX entries for your domain. CNAME A A CNAME CNAME
MX 10
MX 20

You will then need to point your MUA's to in their SMTP Server settings.

share|improve this answer
Not quite - MX priority 10, MX priority 20. The mail is hosted elsewhere, not at my domain at all (although there are two mail servers as part of that set up). Both MX's are A records not CNAMEs as well, as I recalled someone telling me email wasn't always honoured when using a CNAME for an MX - don't ask me why though! – elliotberg May 10 '13 at 7:10
Sorry, I missed the I've had CNAMEs work resolving MX records, as long as the MX record is for the SOA of the domain and not further down the chain. So, if you have external mail servers, why are you running Postfix internally? Performing mail relays? – douggro May 10 '13 at 15:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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