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.

Mail not routing correctly between domains

Discussion in 'E-mail Discussions' started by mauinet, Sep 29, 2004.

  1. mauinet

    mauinet Active Member

    Joined:
    Mar 2, 2004
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Maui
    This is an interesting problem that I'm hoping someone might be able to help me with. Here's the problem. I have to domains hosted on the same machine. Mail services for one of the domains is moved to an exchange server hosted at a remote locations. The MX record is changed to reflect the correct location for mail. Any mail from the outside world routes correcly and is received at the Exchange server. However, mail that's sent from any domain that's hosted on the same cPanel server is sent to and delivered locally. DNS looks correct however it appears that local mail doesn't check MX records for domains that are hosted on the same machine. Is there a way around this ?

    Thanks and Aloha,

    JG
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Yes:

    1. Remove the domain from /etc/localdomains

    2. Add the domain to /etc/remotedomains (create it if it doesn't exist)
     
  3. damainman

    damainman Well-Known Member

    Joined:
    Nov 13, 2003
    Messages:
    515
    Likes Received:
    0
    Trophy Points:
    16
    I'm having the same problem. I changed my clients MX record to point to his exchange server. All his email is working correctly. However when i try to email him, using a email account on the same server i get it bounced back saying no user exists.

    I understand you said to do the above, but can u please explain what each of the above does? I don't want to remove the domain in step 1, and then have other problems appear.

    Thank you in advance for your reply.
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    It definitely won't work until you move the domain from localdomains to remotedomains. The reason is that exim checks the localdomains file and if the domain is in there it won't lookup the MX record and will simply try and deliver the mail locally. If it's in remotedomains, then when you run /scripts/mailperm or upgrade exim and localdomains is remade (as it is) then the domain won't reappear in localdomains. That's why you must remove it from one and ensure it's in the other.
     
  5. damainman

    damainman Well-Known Member

    Joined:
    Nov 13, 2003
    Messages:
    515
    Likes Received:
    0
    Trophy Points:
    16
    Thank you, now i completly understand :)
     
  6. heyjohnboy

    heyjohnboy Well-Known Member

    Joined:
    Oct 7, 2003
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Valencia, CA
    Thanks for the explanation. We always knew to remove the domain from localdomains, but we never knew to add it to remotedomans. It explains why the problem resurfaced the last time we upgraded cpanel. :)
     
  7. doubledome

    doubledome Member

    Joined:
    Sep 14, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Same Idea Different Issue

    Hi All,

    I've already gone through this issue and resolved using the remote domains file. However, we've just discovered that clients with an exchange server cannot send email to other domains on the cpanel server. Is there another step to the process?

    Thanks,
     
  8. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Are they sending emails from the exchanges inbuilt SMTP server into the internet or are they using SMTP AUTH and using your server as a relay? If the latter, then it probably won't work. If the former, then you should check the exhange servers SMTP logs and the logs in /var/log/exim_mainlog as an email is sent to a domain on your server and see what comes up in the way of errors.
     
  9. doubledome

    doubledome Member

    Joined:
    Sep 14, 2004
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Us or Them

    I'm guessing by what you said, that regardless of the issue, it's on their exchange server rather than on our cPanel server.

    Is that correct. We only have 2 clients using external Exchange servers, but both are having this problem so I though maybe it was us.
     
  10. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Well, only checking your logs and them checking theirs would confirm that :)
     
  11. mygregory

    mygregory Active Member

    Joined:
    May 28, 2004
    Messages:
    32
    Likes Received:
    0
    Trophy Points:
    6
    Exim mail routing and outside subdomains

    [As so often happens I found the solution - here it is in case of use to anybody - you just put an MX entry for the subdomain in your local domain's non-autoritative zone and that solves it - Exim doesn't care if a local dns entry is authoritative or not a long as it's local - or is there another reason why this works?]

    Thanks to Chirpy in particular. I have found this thread very enlightening.
    However here is another mail routing anomaly, with exim unable to deliver mail to an outside subdomain of an account.

    I have an account on a cpanel server (domain.com), but the dns is handled outside. A subdomain of this domain (subdomain.domain.com) has it's very own A record and MX record in the authoratative domain zone record on the outside dns service.

    Exim gives an "unroutable mail domain" error whenever it has to send mail to whoever@subdomain.domain.com from a script running under domain.com

    There is not a trace of subdomain.domain.com in any shape or from on domain's machine, neither as a subdomain set up on domain's account, nor as an entry of any other kind.

    do you know why this happens and what can solve it?

    This seems to go entrirely against the whole basis of the domain system. Why doesn't Exim just look for the authoritative zone find the mx record for subdomain.domain.com and deliver withourt complaining. Unless of course Exim is looking at the non-authoritative zone that cpanel created on domain's machine along with the account set-up. If this is what is happening, how do you make exim find the seperate mx record for subdomain.com?

    mygregory :confused:
     
    #11 mygregory, Mar 4, 2005
    Last edited: Mar 4, 2005
  12. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    That probably was the reason. If an SMTP server cannot find an MX record for a domain (or subdomain) it will revert to the A record for the domain if it can find one. If that doesn't exist or is pointing somewhere you don't want it, it will fail.
     
  13. t9clkclnr

    t9clkclnr Well-Known Member

    Joined:
    Jun 11, 2004
    Messages:
    254
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Southern California
    I'm having the same problem with an exchange server

    And I don't quite follow the explaination of how to resolve this.

    I've double checked my locadomains and remotedomains. all is good.

    I've entered the appropriate IP for the remote server in my MX record

    using this: http://www.dnsstuff.com/ the mx record appears correct.

    log shows
    ** user@thedomain.com R=fail_remote_domains: unrouteable mail domain "thedomain.com"

    any insight is going to be appreciated.

    t9
     
  14. coffee23

    coffee23 Active Member

    Joined:
    Nov 13, 2004
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I am also having the "unrouteable mail domain" problems and i have spent 3 days searching here and another well known website and i cant find a fix or get it fixed.

    Any ideas?
     
  15. t9clkclnr

    t9clkclnr Well-Known Member

    Joined:
    Jun 11, 2004
    Messages:
    254
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Southern California
    I had to set the authoritative DNS to point back to the customers windows server

    and instead of pointing the mx record back to the client I am now only hosting the site since a resolve could not be found.

    this was my work around. not sure of your options.
     
Loading...

Share This Page