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.

mail servers

Discussion in 'E-mail Discussions' started by Hoojx, Oct 23, 2004.

  1. Hoojx

    Hoojx Active Member

    Joined:
    Jun 5, 2003
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    6
    I've tried to set up a backup mail server for more than one week but it never works!

    I've a zone with MX records as follow:

    mydomainforexample.abc MX 10 mail
    mail A 10.0.0.1
    mydomainforexample.abc MX 20 mail2
    mail2 A 10.0.0.2

    Both 10.0.0.1 and 10.0.0.2 servers are running WHM/cPanel. I've set up the mydomainforexample.abc account on both servers.

    So, I tried to send an email from 10.0.0.3 to testing@mydomainforexample.abc

    I got this error:
    temporarily rejected RCPT <testing@mydomainforexample.abc>: lowest numbered MX record points to local host on machine 10.0.0.1

    If I moved mydomainforexample.abc from /etc/localdomains to /etc/remotedomains on machine 10.0.0.1, I got this error instead
    'SMTP error from remote mailer after RCPT TO:<testing@mydomainforexample.abc>: host mail.mydomainforexample.abc [10.0.0.1]: .... is currently not permitted to relay through\n550-this server. Perhaps you have not logged into the pop/imap server in the\n550-last 30 minutes or do not have SMTP Authentication turned on in your email\n550 client.

    It is just a very simple thing I want to set up
    If 10.0.0.1 mail server is up, all the emails will go to 10.0.0.1, if it is down, I want the emails to go to 10.0.0.2. All the other accounts on 10.0.0.1 and 10.0.0.2 should do the same as well when sending an email to this domain.

    How should I set up that up?

    Thanks.
     
  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
    On the backup server you have to put the domain into /etc/secondarymx (create the file if it doesn't exist). You should also make sure that mydomainforexample.abc does not exist in /etc/localdomains. If it does, remove it and put it into /etc/remotedomains.
     
  3. Hoojx

    Hoojx Active Member

    Joined:
    Jun 5, 2003
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    6
    Thanks. That works.

    mydomainforexample.abc MX 10 mail
    mail A 10.0.0.1
    mydomainforexample.abc MX 20 mail2
    mail2 A 10.0.0.2

    I tried to send an email to mydomainforexample.abc from 10.0.0.3 (running exim as well) while both servers are up, it goes to 10.0.0.1 which's correct.
    I took down mail server 10.0.0.1 and sent another email, it goes to 10.0.0.2 which's expected, however when mail server 10.0.0.1 is back running, the mail from 10.0.0.3 still goes to 10.0.0.2 ... is that normal?
     
  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
    Yes, because that server (or the DNS server it uses) has probably cached the MX records and will keep sending it to the one that worked the last time until the record expires. If you have multiple MX entries like that, you can and will have email going to both if they're both up, though it should all end up on the primary eventually.
     
Loading...

Share This Page