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.

SMTP Backup - Undone recent changes, but not fixed!

Discussion in 'E-mail Discussions' started by DReade83, Dec 3, 2006.

  1. DReade83

    DReade83 Well-Known Member

    Joined:
    Oct 20, 2006
    Messages:
    196
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Cheshire, UK
    My current setup before any changes were made is explained here: http://forums.cpanel.net/showthread.php?t=59402

    Basically what I now want to do is to have 'mailbackup.domain' as the first MX record, and my Exchange Server as the second. The reason being is I want all email checked by SpamAssassin before being forwarded to the next MX record; thus removing any spam before delivering to my Exchange Server (which has no spam protection).

    Zen Internet have done the very same thing previously with my domains, where their mail cluster (4 servers running Exim 4.x) are the 1st MX record (mailcluster.zen.co.uk) and my domain is the 2nd.

    There are several domains on my server that want this functionality, so for the time being I have only changed my DNS records, as follows:

    domain. MX 10 mailbackup.domain.
    domain. MX 20 mail.domain.

    * mailbackup represents my server IP, and mail respresents my Exchange Server IP.

    I've applied the change direct to the .DB file located under /var/named/ and restarted the BIND service in WHM. I send a few test emails (using the SMTP service on the server, sending from one domain into the domain I've just made the changes to).

    I receive all emails no problem, with no errors.

    However today I have not received the emails I get on a daily basis from the server telling giving me a server status update and so on. I check the Mail Queue to find they're queued, and have been for over 12 hours! I try to release the emails to be told:

    LOG: MAIN
    cwd=/usr/local/cpanel/whostmgr/docroot 3 args: exim -v -qff
    LOG: queue_run MAIN
    Start queue run: pid=8806 -qff
    delivering 1GqhQa-0002bE-W7 (queue run pid 8806)
    LOG: MAIN
    Unfrozen by forced delivery
    LOG: MAIN
    lowest numbered MX record points to local host: domain
    LOG: MAIN
    == admin@domain R=lookuphost defer (-1): lowest numbered MX record points to local host
    LOG: MAIN
    Frozen

    ...And so on...

    I've also noticed that emails from an external location have the same problem!

    I have now reverted back to the original DNS and restarted BIND and EXIM. However the same problem is occuring! Any new emails that come in just queue and I cannot release them!!! HELP!!!

    As a note, I have checked /etc/localdomains, /etc/remotedomains and /etc/secondarymx but these remain unchanged (they're config'd OK).

    Any help on resolving this urgent issue would be greatly appreciated.

    Thanks in advance.
     
  2. nwilkens

    nwilkens Well-Known Member

    Joined:
    May 4, 2006
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Monroe MI
    cPanel Access Level:
    DataCenter Provider
    DNS MX config

    Ok, so MX records just have priority assigned to them. By having multple entries with different priorities, does not accomplish your mail relay you would like setup.

    If host A has SPAM filtering, and B is you exchange server.

    Host A would exist in MX record only. Host A would have rules configured to take all mail belonging to Host B and forward them or relay them.

    I hope I understood your problem properly.

    Also, refer to http://en.wikipedia.org/wiki/MX_record for more info on MX record priorities
     
  3. rikgarner

    rikgarner Well-Known Member

    Joined:
    Mar 31, 2006
    Messages:
    75
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    /dev/null
    Hi Dave,
    Im sorry, but I don't think that the standard Exim configuration with Cpanel is capable of doing what you want.

    If I understand it correctly, you are talking about using Exim as an SMTP gateway like me$$agelabs, whereby your Cpanel server accepts all your incoming email, filters it, and sends it on.

    However, the exim configuration within Cpanel does not support this - it is set up for mail performance, so it routes mail via the quickest route it can. As it is processing through the routers for your mail, it will see "lookup" as the transport, will perform an MX lookup on your domain, and find that itself is the primary MX. As this would cause a mail loop, you get your error.

    The other problem is that a number of spam-senders send to the secondary MX to start with to try and avoid mail filtering.

    What you would need to do is run a second instance of Exim with a seperate routing-config which uses a manual-routes table to lookup routing hosts:

    1. Exim Daemon accepts the mail on port 25
    2. Spamassassin processes
    3. Spamassassin failed mail gets junked
    4. Spamassassin passed mail gets queued in second Exim queue
    5. Second Exim instance processes its queue, and uses the specific routes to deliver mail.

    You could use MailScanner to achieve this (as it sets up two seperate Exim queues), or set it up from scratch yourself (the official Exim guide is a good start for this), but note that Cpanel will probably not support any email problems you have in this configuration.

    I would have to add that it is probably too complicated to do this through forum-feedback, as you could run up against something which disables your mail while you wait for a reply - my advice would be to get an experienced admin (someone who has done it before) to do this.

    To get you back up and running, either set Exim as the primary MX and use Dataenter.co.at 's PopBeamer to download and pass mail to Exchange, or set the MX's to be your Exchange server, however either way you are going to have to put up with the spam.

    Rich
     
Loading...

Share This Page