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.

Local email doesn't care about MX settings

Discussion in 'E-mail Discussions' started by mstuebner, Mar 13, 2009.

  1. mstuebner

    mstuebner Well-Known Member

    Joined:
    May 13, 2007
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    Hello all,

    I recently realized that email that is send from an account A to another acount B doesn't care about set MX-entries at account B. Is that known or are there workarounds?

    On account B I host a domains whose email is managed by Google and MX are set this way. But email send from the local server doesn't care of that MX-setting and deliveres as email would be handled locally for that domain.

    That means, to get the email to the domain at Google, I have to pass it through a third domain that is not hosted on that server. Can't be a solution.

    Does someone have a hint?

    Thx, Matthias
     
  2. Zishan

    Zishan Well-Known Member

    Joined:
    Aug 6, 2005
    Messages:
    104
    Likes Received:
    1
    Trophy Points:
    0
    If the emails for a domain are being handled outside then two things need to be done:

    1- Update the MX record for the domain to point to external Mailserver.
    2- Remove the entry for the domain from /etc/loaldomains and add it to /etc/remotedomains to tell the mailserver that the emails for that domain will be handled outside.

    You should make sure that both of these things are done. You can also trace the email address to see how exim handles it as:

    exim -bt -d user@domain.com
     
  3. mstuebner

    mstuebner Well-Known Member

    Joined:
    May 13, 2007
    Messages:
    50
    Likes Received:
    0
    Trophy Points:
    6
    That worked perfectly! But I wonder whether step 2 has to be done manually? After moving the domain, the delivery is as expected.

    Thank you many time, Matthias
     
  4. Zishan

    Zishan Well-Known Member

    Joined:
    Aug 6, 2005
    Messages:
    104
    Likes Received:
    1
    Trophy Points:
    0
    Yes, it will have to be done manually.
     
  5. grose

    grose Registered

    Joined:
    Mar 23, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I have this same issue, but I can't seem to figure out where to implement the steps that were outlined above. When I view the directory structure for my main domain (mydomain.net), I have the /etc directory, but the only folders under there are: /etc/mydomain.net and /etc/mydomain.com. (mydomain.com is parked on mydomain.net.) I need to get email generated by a form on the website to go to the external email server as user@mydomain.com.

    I have already set up a subdomain of mail2.mydomain.com and forwarded it to the external email server and set an MX entry directing any email sent to mydomain.com to mail2.mydomain.com.

    What steps do I need to take in this case for the locally created emails?

    Thank you in advance for your help.
     
  6. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    It sounds like you are referring to ~/etc (etc directories within a cPanel account) not /etc (the root-level etc directory on the server). If you do not have root-level access to the server, you will be unable to manipulate /etc/remotedomains and /etc/localdomains but your hosting provider can do that for you.

    You say you forwarded mail2.mydomain.com to the external mail server. Did you do this by setting the MX entry for mail2.mydomain.com or by some other means?
     
  7. grose

    grose Registered

    Joined:
    Mar 23, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Thank you for the detailed response. I think that is what I needed to know.

    To answer your question more fully: mail2.mydomain.com was redirected to the IP address where the mail server is located under the Subdomain Manager section of CPanel. Was this correct?
     
  8. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    That will only redirect HTTP (website) traffic. It will not redirect mail traffic. To redirect mail, you will need to set the MX entry for mail2.mydomain.com to the IP address or hostname of the server where you where you want mail redirected.
     
  9. grose

    grose Registered

    Joined:
    Mar 23, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    How do you do this since the MX configuration section of CPanel only allows for fully qualified domain names?
     
  10. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Use the hostname of the mail server.
     
  11. grose

    grose Registered

    Joined:
    Mar 23, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I found a tool to find the hostname from the IP address. That (or the other) seems to be working at present. Thank you for your help.
     
Loading...

Share This Page