I run a dedicated box. One of my customers (let's say domainx.com) runs their own email server at their office, so we changed the MX record for them.

The problem is - mail sent from the server itself looks at the /etc/localdomains file and sees:


So it doesnt' send on the email to their server via the MX record, but dumps it to their catch-all inbox on my server. When I manually remove that line from /etc/localdomains, it works fine. But the line keeps on adding itself!

My hosting company has recommended locking the file using:

chattr +i /etc/localdomains

But then I'd have to remember to unlock every time we add a new domain, then relock it, etc. This seems odd... and wrong. What other solution am I missing?