2

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;

domain.com CNAME to server.domain.com
server.domain.com A to 1.1.1.1
MX mail.maildomain.com priority 10
MX mail1.maildomain.com priority 20

the server with issues is server.domain.com.

Thanks

5
  • 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? sendmail.com/pdfs/open_source/installation_and_op_guide.pdf
    – douggro
    May 8, 2013 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, 2013 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, 2013 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, 2013 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, 2013 at 16:03

2 Answers 2

1

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

Remove the CNAME OR add MX records for server.domain.com

4
  • 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, 2013 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.
    – AnFi
    May 10, 2013 at 7:18
  • OK - just changed that over then, let's see what happens! :)
    – elliotberg
    May 10, 2013 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, 2013 at 10:05
0

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.

domain.com CNAME server.domain.com
server.domain.com A 1.1.1.1
server2.domain.com A 1.1.1.2
mail.domain.com CNAME server2.domain.com
mail1.domain.com CNAME server.domain.com
MX mail.domain.com 10
MX mail1.domain.com 20

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

2
  • Not quite - MX mail.maildomain.com priority 10, MX mail1.maildomain.com 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, 2013 at 7:10
  • Sorry, I missed the maildomain.com. 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, 2013 at 15:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .