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.

E-mail on a different server

Discussion in 'E-mail Discussions' started by netvistun, Mar 16, 2005.

  1. netvistun

    netvistun Active Member

    Joined:
    Mar 10, 2005
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    We're running WHM/Cpanel with 60-80 users.

    One of your clients has their homepage hosted in our server but e-mail on another server. This does not seem to be a problem. The homepage works and everything and I can send him e-mail and he sends me e-mail, but when the machine sends mail it thinks the e-mail is on the server and sends it streight to the user without going out of the box and onto a dns that redirects it in the right place.

    How can I make the machine stop sending the mail directly without putting it streight back.

    When I trace the e-mail it only shows one spot, it doesn't route at all.

    How can this be done?
     
  2. kirkmiesle

    kirkmiesle Member

    Joined:
    Jan 18, 2004
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    OHIO
    I'd like to know this, too :)
     
  3. jambalaia

    jambalaia Registered

    Joined:
    Feb 17, 2005
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    We had the same experience here, but using external DNS servers (the DNS was not in CPANEL):

    WHM -> DNS Functions -> Delete a DNS Zone -> "domain you have only the page"
    in /etc/localdomains remove the line with the domain
    in /etc/remotedomains insert one line with the domain

    Using CPANEL DNS I believe you will have to remove the domain from /etc/localdomains and in WHM -> DNS Functions -> Edit and MX Entry you will need to point the domain to the correct server.

    Maybe someone knows a better way, sorry for the bad english.
     
  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
    Yup, just point the MX to an A record that you create pointing to the IP address of the external mail server (don't point the MX record directly to an IP address) - no need to delete the zone file for the domain at all. Then:

    1. Remove the domain from /etc/localdomains

    2. Add the domain to /etc/remotedomains (create the file if necessary)

    That last step is essential otherwise cPanel will simply re-add it to /etc/localdomains
     
  5. netvistun

    netvistun Active Member

    Joined:
    Mar 10, 2005
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    small explaination

    Hi again

    I should have included it in my question that we're using another DNS server, not Cpanel's. That one is set up correctly and I'm able to send e-mails to the right domain if I just send from my e-mail client, but not through, for instance, PHP's mail function.

    thank for a quick reply
     
  6. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You will still need to do the two steps I mentioned.
     
  7. netvistun

    netvistun Active Member

    Joined:
    Mar 10, 2005
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Doesn't seem to do the trick

    Well, it doesn't seem to do the trick. The mails all get delivered locally.

    Also if I trace the e-mail address, It is routed locally.

    (and yes, I did restart exim :) )
     
  8. netvistun

    netvistun Active Member

    Joined:
    Mar 10, 2005
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    Not working...

    So I should give up?
     
  9. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    If moving the domain from localdomains to remotedomains does not work, then I would hazard a guess that although their DNS is hosted elsewhere, do you still have a zone file for the domain in WHM? If so, delete it from the local server, then try again.
     
  10. sleuth1

    sleuth1 Well-Known Member

    Joined:
    Mar 16, 2003
    Messages:
    75
    Likes Received:
    0
    Trophy Points:
    6
    You may be better off using local dns for this problematic domain , the switch should only take 10/40 minutes on a good dns host , then in whm >dns settings create the mx zone for the other mail server , if it is mail.somedomain.com , you may have to remove the c record in whm dns, because it will point to the server itself (ie mail.somedomain.com always points to current server ip by default ) then check that the off server, mail server has a A record (use dns report for instance) if any doubt create one in Whm >add dns > with the off server ip eg mail.somedomain.com ip 666666666
     
  11. netvistun

    netvistun Active Member

    Joined:
    Mar 10, 2005
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    I would delete the zone

    Hi again

    I would delete the zone, but it has so many references. We're also running SSL on that server. I'm afraid if I delete it, It would stop functioning correctly.

    Here're the zones, it doesn't look like it's something I can delete

    [​IMG]

    best regards
    Arnór Heiðar
     
  12. netvistun

    netvistun Active Member

    Joined:
    Mar 10, 2005
    Messages:
    26
    Likes Received:
    0
    Trophy Points:
    1
    One other thing

    Named isn't running. Shouldn't that mean that the DNS zone has no effect?
     
  13. hostseeker

    hostseeker Well-Known Member

    Joined:
    Sep 4, 2001
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    6
    Chirpy can you go in to a little detail on how to do that with WHM? I went to the edit DNS zone section and didn't see how to do exactly what you were talking about.
     
  14. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Sure, you would login to WHM > DNS Functions > Edit a DNS zone > select the zone that has its MX records off-server > Edit >

    Say the domain is called domain.com where 11.22.33.44 is their mail servers IP address, you would then add:

    altmail.domain.com. 14400 A 11.22.33.44

    Then change the MX record line to read:

    domain.com. 14400 MX 0 altmail.domain.com.

    Then save the zone. That will have to propagate to become fully effective (usually around 24 hours). You must also remove the domain from /etc/localdomains and add it to /etc/remotedomains (and create that files if it doesn't exist).
     
  15. hostseeker

    hostseeker Well-Known Member

    Joined:
    Sep 4, 2001
    Messages:
    85
    Likes Received:
    0
    Trophy Points:
    6
    Thanks Chirpy!

    Since it was an exchange server I created an A record as follows:

    exchange 14440 in A 11.22.33.44

    Then I changed the MX to read:

    domain.com 14400 in MX 0 exchange.domain.com.

    You might be interested to know that it seems that the later Cpanel do not require you to remove the domain from etc/localdomains or add it to etc/remotedomains as when I went to do that it had already been done for me in both files! Using Cpanel 10.0.0 R-149
     
  16. 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's great :)

    Interesting about the localdomains/remotedomains.
     
  17. adixon

    adixon Member

    Joined:
    Feb 16, 2005
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    I have this exact same problem. Removing them from localdomains and into remotedomains works. However I a tickbox option would be great for this :(

    As I dont use the name server at all on the cpanel server. And allot of clients will be hosting their mail on a more redundant mailnetwork. So I need a better more automated solution to automatically put them in remotedomains. Anyone know how this could be possible or will I have to wait for this to be feature-requested?
     
  18. chirpy

    chirpy Well-Known Member

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

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    Probably a stupid question for people who know DNS zone files well... but after you add the MX record and A record as described above, what happens to the CNAME entry, eg:

    mail 14400 CNAME domain.com.au

    Do you *need* to delete it, or assuming you've done the MX and A correctly perhaps it's redundant and it doesn't matter whether it's deleted or not?

    Thanks.
     
  20. 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's redundant.
     
Loading...

Share This Page