The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

how to disable the local domain logic in exim?

Discussion in 'General Discussion' started by albuck, May 25, 2006.

  1. albuck

    albuck Registered

    Joined:
    May 25, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  2. tweakservers

    tweakservers Well-Known Member

    Joined:
    Mar 30, 2006
    Messages:
    379
    Likes Received:
    0
    Trophy Points:
    16
    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
     
  3. louish

    louish Member

    Joined:
    Feb 2, 2006
    Messages:
    23
    Likes Received:
    1
    Trophy Points:
    3
    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?
     
  4. louish

    louish Member

    Joined:
    Feb 2, 2006
    Messages:
    23
    Likes Received:
    1
    Trophy Points:
    3
    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
     
  5. louish

    louish Member

    Joined:
    Feb 2, 2006
    Messages:
    23
    Likes Received:
    1
    Trophy Points:
    3
    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!
     
  6. albuck

    albuck Registered

    Joined:
    May 25, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  7. randomuser

    randomuser Well-Known Member

    Joined:
    Jun 25, 2005
    Messages:
    147
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
  8. louish

    louish Member

    Joined:
    Feb 2, 2006
    Messages:
    23
    Likes Received:
    1
    Trophy Points:
    3
    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..
     
Loading...

Share This Page