Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 two servers relavant here:

mail.domain.com (1.1.1.1) - which is the nameserver and the mail server for domain.com. www.domain.com (2.2.2.2) - which is the www subdomain for domain.com domain.com (cname www.domain.com) - an alias for www.

The zone file for domain.com lists mail.domain.com as the MX server for domain.com.

2.2.2.2 is actually being served web pages as a virtual host. It's real hostname is www.anotherdomain.com.

Mail for domain.com works pretty well, in general. However, if I attempt to send mail from www.domain.com (or its alias domain.com), I get "mail for domain.com loops back to myself" in the postfix logs.

On 2.2.2.2 /etc/postfix/mail.cf has mydestination = www.anotherdomain.com, localhost.

How do I tell postfix on 2.2.2.2 that mail for domain.com needs to be delivered to mail.domain.com?

share|improve this question
up vote 1 down vote accepted

What I ended up doing, for anyone interested, is to undo the cname 'domain.com'. The result being that domain.com resolves to 1.1.1.1. www.domain.com still points to 2.2.2.2. Next, I set-up a virtual host on 1.1.1.1 that only uses mod-rewrite to redirect requests to www.domain.com. It isn't ideal since those going to 'http://domain.com' will need to do 2 DNS lookups + a redirect, but at least mail works properly again.

share|improve this answer

You must log in to answer this question.

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