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?