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.

backup mailserver

Discussion in 'E-mail Discussions' started by 10101, Aug 18, 2005.

  1. 10101

    10101 Well-Known Member

    Joined:
    Sep 4, 2003
    Messages:
    151
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    I know this has prob been asked but I can't find anything helpfull on the forum.

    I have two servers and I want to have it so that in the event of server 1 being down, email is collected on server 2 and then delivered once server 1 recovers.

    Is this possible with cpanel? NDC host offer this service however I would rather have it all running on my own hardware: http://www.cplicensing.net/smxplans.php

    Any help would be appreicated, I'm sure there are a lot of other people out there who would like this setup.

    thanks,
     
    #1 10101, Aug 18, 2005
    Last edited: Aug 18, 2005
  2. nickb

    nickb Well-Known Member

    Joined:
    Feb 25, 2005
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    If both are cpanel servers then you need to do following changes :

    Server1: (on which domain is hosted)

    Create a backup MX record for the domain which points to the backup mail server like this :


    backup.yourdomain.com. 14400 A IP-of-backup-mail-server
    yourdomain.com. 14400 MX 10(must be higher) backup.yourdomain.com.


    Server2: (backup mail server0

    pico /etc/secondarymx

    and add your domain name "yourdomain.com." in this file. Thats it.
     
  3. 10101

    10101 Well-Known Member

    Joined:
    Sep 4, 2003
    Messages:
    151
    Likes Received:
    0
    Trophy Points:
    16
    Hi Nick,

    I have already done that and it does work but Im looking (sorry I should have said) to have it so that I don't have to edit the "secondarymx" file as when new accounts are created on the server it means having to remember to do that.
     
  4. nickb

    nickb Well-Known Member

    Joined:
    Feb 25, 2005
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    You need to create a postwwwacct script to do so..........hope you will create it and post it here also...
     
  5. 10101

    10101 Well-Known Member

    Joined:
    Sep 4, 2003
    Messages:
    151
    Likes Received:
    0
    Trophy Points:
    16
    I'm surprised that cpanel do not offer better clustering services, DNS is a start but a redundant mailserver is a must.
     
  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
    Alternatively, you could just regularly rsync your /etc/localdomains file across which would effectively do the same thing.
     
  7. 10101

    10101 Well-Known Member

    Joined:
    Sep 4, 2003
    Messages:
    151
    Likes Received:
    0
    Trophy Points:
    16
    I've been looking for a way to do this but I need it to work across multiple servers to, say servers 1 2 and 3 etc all use the backup mailserver.

    is it possible to rsync it so that the localdomains file from say 3 servers is appended to the one on the backup mailserver?
     
  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
    Not something I've tried. I'd probably script it something like:

    Script runs every XX minutes on backup mail server and:

    1. Rsyncs remote /etc/localdomains files to a local cope in /somedir/server/localdomains
    2. Appends all /somedir/*/localdomains together
    3. Writes the result out to /etc/secondarymx
     
  9. 10101

    10101 Well-Known Member

    Joined:
    Sep 4, 2003
    Messages:
    151
    Likes Received:
    0
    Trophy Points:
    16
    That's what i was wanting to do but cant code lol.
     
  10. gflamerich

    gflamerich Well-Known Member

    Joined:
    Jul 21, 2003
    Messages:
    122
    Likes Received:
    0
    Trophy Points:
    16
    And how about accounts verification?

    Hi
    We would like to activate some multiple mailservers (We are having some troubles with ISP's that doesn't have a retry policy delivering mails, they just bounce at the first attempt failure), we will try the solution written by Chirpy for the domains, but don't know how to handle account verification.
    We would like to bounce non valid recipients on every mails server and don't even accept for further delivery.
    Is there any way to do this?
     
  11. chirpy

    chirpy Well-Known Member

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

    gflamerich Well-Known Member

    Joined:
    Jul 21, 2003
    Messages:
    122
    Likes Received:
    0
    Trophy Points:
    16
    Thanks Jonathan
    But this doesn't resolve what we asked, because if a sencondary mailserver is reached, is because the primary is down, so the ACL verification won't work (I think).
    What we want is to have multiple mailservers that rejects non valid recipient addresses on any of them. Otherwise a secondary mailserver will accept for further delivery a non valid address.
     
  13. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Very true. And I don't know of a solution for that with the setup that cPanel/exim uses. I'm sure that it's perfectly possible, but you'd have to do some custom scripting+exim config to do it.
     
  14. NetBlaster

    NetBlaster Member

    Joined:
    Jun 12, 2004
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    Can I just have another Linux box with Exim as a secondary MX?

    In otherwords, do I have to have Cpanel on both? If not, would Exim be all that I would need?

    Thanks,

    Ron...
     
  15. 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 can run pretty much any SMTP server that you want that has the ability to relay as a backup MX: exim, sendmail, qmail, etc.
     
  16. 10101

    10101 Well-Known Member

    Joined:
    Sep 4, 2003
    Messages:
    151
    Likes Received:
    0
    Trophy Points:
    16
    I've done this and it works however I'm finding email on the backup mailserver when the main server hasnt even been down. It's not normal delivered email but rubbish like erewr@domain.com.

    Anyway to stop email from hitting the backup server unless the primary is actually down?

    note: i have setup dns cluster too.
     
    #16 10101, Dec 22, 2005
    Last edited: Dec 22, 2005
  17. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Not really, no. You can always expect email to go to either server as some email clients will ignore the MX priority (especially spammers).
     
  18. 10101

    10101 Well-Known Member

    Joined:
    Sep 4, 2003
    Messages:
    151
    Likes Received:
    0
    Trophy Points:
    16
    Thanks Chirpy, thats what i thought.
     
  19. jensendw

    jensendw Member

    Joined:
    Aug 7, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    All I did before when I needed something that would suffice and handle my volume of email and be cost effective was to go get a Virtual Server from somewhere, set sendmail to act as a backup mailserver, it effectively bufferered the incoming mail while main server was down, and when the main server came back up it just handed it all the emails, all I can say is that it worked and I never had any problems, if you have several servers with a large volume of email you may want to try a better approach though.
     
  20. Berbox

    Berbox Well-Known Member

    Joined:
    Apr 4, 2005
    Messages:
    55
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Belgium
    Quote:


    The reason why you get the spam emails is not beeing related by the dns but with you catchall account. If you enable the catchall on the backup server, all mail addresses not configured at the first mx server will be dilivered to the backup mailserver.
    You can easely test this by going to dnsreport.com and fill in any email address you want. Each server gives its reply. If the first mx fail the second mx will be jused.

    I hope I'm right but the problem now is wenn I disable the catchall on the backup that the backup sever doesn't work because he says always:
    "Got an unknown RCPT TO response: 550-"The recipient cannot be verified. Please check all recipients of this 550 message to verify they are valid."​

    Can somebody explain to me if the mail will be put in the queue of the backup server. This server then will try to deliver it to the first mx?
    In the previos post I read something about sendmail. Can i configure this solution next to exim in cpanel and is there some tutorial to do this?

    Thanks
     
Loading...

Share This Page