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 Questions

Discussion in 'E-mail Discussions' started by Lyttek, Feb 4, 2006.

  1. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    I'm working on a project related to 100% availability of email and have a few questions that I hope to have answered before doing real-world tests. These questions do not directly relate to operations using cPanel, but since I've found this to be one of the best resources on the net... So, do not assume that any answer must remain within the confines of "cPanel can/can't do that".

    1) assume domain.com has mail-1.domain.com and mail-2.domain.com as mailservers, primary and secondary respectively. If mail-1 goes down, mail is routed to the secondary.

    Q1: If email accounts are created on mail-2 that are identical to accounts on mail-1, are messages delivered to the mailbox on mail-2, rather than being stored for later delivery on mail-1? (username@domain.com exists on both mail-1 and mail-2 servers)

    Q2: Assuming yes to Q1 above, is it possible to re-queue these messages for delivery to the accounts on mail-1 on a later date, or will queueing the messages create a scenario in which delivery attempt is made to mail-2 since mail-1 is down, creating a loop?

    Q3: If email accounts are created on mail-2 which are not identical, but somehow mapped to the accounts on mail-1, how would this mapping occour? Could the message then be copied to the mapped account and still be queued for delivery once mail-1 was back online?

    Q4: If no accounts are created on mail-2, but it is used as secondary MX to domain.com, where are the messages stored while awaiting mail-1 to come back online? What form do they take?
     
  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
    Q1 - yes
    Q2 - no because it'll create a loop
    Q3 - no, same issue with Q2
    Q4 - they reside in the local SMTP servers mail queue. Delivery will be attempted according to that local queues settings. Each time the queu is run and it matches the appropriate delivery interval the local SMTP server will try to contact the lower scoring MTA and deliver to it if it replies

    What you're trying to do isn't a backup MX service unless you solely do Q4. Having said that, it might be possible, but you'd likely have to customise the code of an existing SMTP server which would be a lot of work.
     
  3. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    Thanks for the info :)

    On Q3, it would be something along these lines:

    Let's say the original message is for user@domain.com. The secondary system has an email account called spare-user@spare-domain.com

    When an email comes into the secondary, addressed to user@domain.com, it is placed in the queue for later delivery when the primary is back online. It is ALSO, using mailscanner or similar mechanism perhaps, copied into the inbox of spare-user@spare-domain. Thus, the user can access the message now through the spare account, AND have it delivered later into their normal inbox.

    So I guess Q5 becomes: Can messages coming in for delivery to a remote domain be processed by MailScanner? First thought says no, but...
     
  4. Lyttek

    Lyttek Well-Known Member

    Joined:
    Jan 2, 2004
    Messages:
    770
    Likes Received:
    3
    Trophy Points:
    18
    Well Holy @%^@, it works!!

    Ok, here's the setup, the test, the results:

    * registered a new domain pointing to ns1.myserver.net for nameservices: testdomain.com
    * created a DNS zone: testdomain.com that points to private IPs, primary MX is pointing to testdomain.com so it can't resolve. secondary points to actual server (myserver.com)

    * on myserver.com, listed testdomain.com in /etc/secondarymx
    * using archive.rules in mailscanner, set a rule: To: awflint@testdomain.com forward user@myserver.com

    * logged onto yahoo account, sent an email to awflint@testdomain.com

    * email delivered to user@myserver.com AND it's sitting in the mailqueue waiting to be delivered to mail.testdomain.com

    Anyone able to duplicate and verify? Please? :)
     
  5. vinc_dc43

    vinc_dc43 Well-Known Member

    Joined:
    Jan 19, 2003
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    6
    this is the way i have all three of my backup mx servers working :)
     
  6. rpage

    rpage Member

    Joined:
    Feb 13, 2002
    Messages:
    22
    Likes Received:
    0
    Trophy Points:
    1
    Sorry for posting on an old thread, well it's not that old, but I have stumbled upon it and I am looking to do something similar. My question is when someone creates an email address on the primary mail server, how does the backup email account get created on the secondary mail server? Is there a way to get this automatically added to the archive.ruleset file? I would like to give my customers the options of putting in an alternative email address (gmail,hotmail,yahoo,etc) in which a copy of their emails going to the secondary mail server can be sent to using the archive.ruleset feature.

    On another note, I am sure I already know the answer, but one should never assume. The secondary mail server is great for catching and storing incoming mail. If a user cannot connect to the primary mail server for some reason to send mail, can they be redirected to the secondary?

    Thanks in advance for your input.
    Rick
     
Loading...

Share This Page