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.

Secondary MX

Discussion in 'General Discussion' started by nunixo, Nov 22, 2006.

  1. nunixo

    nunixo Registered

    Joined:
    Jun 16, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi there,

    we have a cpanel server where we have our main domain, and some of our customers domains. And we have a second server with cpanel too that host more customers. We want to setup the second server as secondary mx for some accounts hosted on the first server.

    Can someone please tell me if this is possible and how can this be done?
     
  2. gupi

    gupi Well-Known Member

    Joined:
    Apr 27, 2004
    Messages:
    125
    Likes Received:
    0
    Trophy Points:
    16
    1) In /etc/secondarymx file on the second server, add the domains you need to have secondary MX, one at a line
    2) in DNS records of the desired domains, add stating something like this:
    example.com. IN MX 10 secondserver.yourdomain.com.
     
  3. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    And as a helpful side note... that question would have been answered about 10 times by using the search function ;)
     
  4. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    Something no one could answer yet, is how does the secondary mail server know about all the email accounts, and what does the administrator need todo everytime a user adds an email account to his domain?
     
  5. Wallaby

    Wallaby Well-Known Member

    Joined:
    Aug 15, 2001
    Messages:
    131
    Likes Received:
    1
    Trophy Points:
    18
    All a secondary mailserver does is store mail that cannot be delivered to the primary, until such time as it can forward it back to the primary server.

    If you want 2 mailservers each with all the email accounts and so on set up, you need to do the setup manually, and also (I believe -- check this) have the two MX records set to the same priority in the DNS. You would not really want to do this though. Even a conventional secondary MX is of limited value, as if your mailserver is down the sending server will keep retrying, for up to 5 days usually.
     
  6. SoftDux

    SoftDux Well-Known Member

    Joined:
    May 27, 2006
    Messages:
    983
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Johannesburg, South Africa
    cPanel Access Level:
    Root Administrator
    Ok, but how does the secondary mailserver know which mail goes where?
     
  7. lostinspace

    lostinspace Well-Known Member

    Joined:
    Jul 19, 2003
    Messages:
    122
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Colorado Springs, CO
    The secondary server does nothing with routing other than store the messages for later delivery.

    For example:
    domain.com set up with 2 MX records.
    mx1.domain.com
    mx2.domain.com

    mx1 hosts domain.com and mx2 is a backup (priorities are 0 & 10 respectively).

    So assume mx1 goes down...

    Any sending mail servers attempt a connection with mx1 (based on the DNS MX record and priority - in this example "0"), when there is no response, the sending mail server looks for the next highest mx priority, in this case, mx2 (priority "10"). mx2's "/etc/secondarymx" file tells mx2 that even though the domain is not hosted locally, it should queue the message for later delivery to mx1. The message will not be routed to any inboxes locally on mx2 (i.e, you won't be able to log into mx2 and check the e-mail for any domains in the "/etc/secondarymx" file). mx2 will poll mx1 and once mx1 responds, mx2 will deliver the messages intended for mx1's local domains.

    All a secondary mail server does is prevent bounced messages after the 5 days or so. Of course it also prevents you from loosing important messages should you suffer an extended outage. Although, if your primary server is down for more than 5 days you'll probably have bigger issues by then - heh.

    You might be looking for a mail forwarding service (something that delivers a copy of email to a whole separate server for local delivery. This is a whole different ball game. Check out some of the third party DNS services out there for mail forwarding.

    From http://www.zoneedit.com/:
    Of course such a great service is not free.
     
    #7 lostinspace, Dec 22, 2006
    Last edited: Dec 22, 2006
Loading...

Share This Page