how to disable the local domain logic in exim?

albuck

Registered
May 25, 2006
2
0
151
I am just getting started with cPanel on a remote host. I handle all the email for my various domains on a local machine with my own mail server, my own DNS records, my own unpublished primary name server, etc. That machine also was running these sites on its web server.

After migrating the web sites to a cPanel managed machine, the web sites work fine. Alas, cPanel has helpfully rewritten various parts of exim, and some name server records I presume, to manage local email for me. This email now goes into a black hole, since the local name server records are ignored (I control the DNS records on other DNS servers which are authoritative for that domain).

I made a temporary workaround by setting the cPanel hosted domain to always forward to another domain (which I haven't moved yet). This will work until I finally have to move the last domain, of course... :-(

I see there is a file /etc/localdomains, and I suppose that I could just edit this file, but I worry about cPanel updates and installation of new sites that will rewrite this configuration at inconvenient times, etc., etc.

What is the officially approved mechanism to have cPanel *not* be helpful and try to deal with email? Can I have cPanel just leave the email alone for now and treat the local domain just like any other domain and deliver the email normally off site?

PS Is there any simple way to recover all the zombie local emails that are sitting in the exim queue, never to be delivered locally?


Thanks alot! I really appreciate your help.

Lester
 

tweakservers

Well-Known Member
Mar 30, 2006
379
0
166
You may try remove the domains entry off the /etc/localdomains and add it in /etc/remotedomains , both files will not have the same domain entry loaded
 

louish

Active Member
Feb 2, 2006
25
1
153
Didnt Work

Ive been having the same problems, and I even changed the MX records on the cpanel / whm to point to the correct MX records. But even after removing the domain from the localdomains and adding it to remotedomains and then restarting the mail server, all mail being send FROM the cpanel server to the domain I need redirected to different mx records, still go to the default address setup in cpanel.

Any other solutions or reasons why this wouldnt solve my problem?
 

louish

Active Member
Feb 2, 2006
25
1
153
FYI, here were my steps.

I SSH'd as root into /etc/localdomains and removed my domain from the list and saved the file. I vi'd into remotedomains (and it said it was a new file) and added the domain tot he file, then saved it. I also chown'd the file as root:mail since those were the permissions on the localdomains file.

I restarted BIND, EMAIL, and CPPOP


Still not working. all mail being sent from this server to the domain that I need the MX hosted elsewhere is being delivered to the default address set to the domain in cpanel.

I dont get it... thanks
Clint
 

louish

Active Member
Feb 2, 2006
25
1
153
Finally Figured it out after reading and testing more stuff. Once I changed the MX record directly through cpanel (vs dns editor directly) it started working. So even though I already did all those steps, it never worked, so editing the mx record through cpanel must do something else in addition to editing those files......

thanks!
 

albuck

Registered
May 25, 2006
2
0
151
Back in May, I asked about how to disable the local domain logic in exim, the first post in this thread. There were some related issues discussed, but no direct answer to my question. After learning *way* too much about exim and how to read its log files, I finally figured out how to disable the local domain logic.

The key to the problem is that, as far as exim's /etc/localdomains file is
concerned, the following two domains are completely separate:

mydomain.com
host.mydomain.com

Since my local host was reporting itself as in the domain "host.mydomain.com", the "mydomain.com" line in /etc/localdomains was not preventing the email from being delivered locally and ignoring the MX record for that externally served domain.


Local and remote email now works fine for me, being delivered where the MX records tell exim to find the mail server(s).

Best regards,

Lester
 

randomuser

Well-Known Member
Jun 25, 2005
147
0
166
louish said:
Finally Figured it out after reading and testing more stuff. Once I changed the MX record directly through cpanel (vs dns editor directly) it started working. So even though I already did all those steps, it never worked, so editing the mx record through cpanel must do something else in addition to editing those files......

thanks!
That's a HUGE "gotcha" with cPanel that I don't believe is really documented anywhere. On cPanel servers, you're always better off editing/making changes if cPanel/WHM offers the availability to do so (such as zones, exim config files, and so on), vice doing things manually. I can only wonder how many people bang their heads against the wall every day wondering why their changes aren't sticking, even though what they're doing is perfectly valid, just manually.
 

louish

Active Member
Feb 2, 2006
25
1
153
Im glad these posts stay here. I got another server.. had the same problem, luckily, i was able to come here and read how i fixed it the first time..