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.

Passing mail to another server

Discussion in 'E-mail Discussions' started by shacker23, Oct 13, 2005.

  1. shacker23

    shacker23 Well-Known Member

    Joined:
    Feb 20, 2005
    Messages:
    263
    Likes Received:
    1
    Trophy Points:
    16
    If you want mail for a domain on server #2 to be handled by a separate server #1, you need to remove the domain name from /etc/localdomains on #2 -- otherwise it will attempt to deliver mail originating from scripts, weblogs etc. to mailboxes on #2, which don't exist, rather than to the remote server #1.

    So if the domain name is present in localdomains on #2, the server tries to deliver messages to local accts, which don't exist.

    But if the domain is NOT present in localdomains on #2, the message also doesn't go through -- server #1 complains :

    (host.domain.com) [IP] is currently not permitted to\n550-relay through this server. Perhaps you have not logged into the pop/imap\n550-server in the last 30 minutes or do not have SMTP Authentication turned on\n550 in your email client.

    So how can I allow mail originating from root or other scripts to be passed to the other server?

    Thanks,
    Scot
     
  2. Freezer

    Freezer Well-Known Member

    Joined:
    Jun 13, 2005
    Messages:
    120
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Den Haag
    Have you filled in your domain in /etc/secondarymx ? That's nessecary for relaying mail.
     
  3. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    No it isn't, that's only necessary if you're using a backup MX service.

    The procedure is to:

    1. Remove the domain from /etc/localdomains and add it to /etc/remotedomains and create that file if it does not exist, otherwise the doamin will keep reappearing in localdomains

    2. Change the MX record for the domain to point to an A record which points to their IP address on the remote server

    That should be it as far as the local server is concerned. Do make sure that if there are any local DNS zone files for the domain that they are also correctly pointing their MX records to the remote server if you use the local named for DNS resolution.

    The last bit on the remote server is a matter of configuring it correctly to accept email for the domain for relaying locally and that will depend on how you have the remote server setup. If it's using cPanel then the obvious way would be to create an account for the domain.

    The alternative to this, if you want to keep the MX on the local server is to use an exim smart router, which you can search about on the forums.
     
  4. shacker23

    shacker23 Well-Known Member

    Joined:
    Feb 20, 2005
    Messages:
    263
    Likes Received:
    1
    Trophy Points:
    16
    Hi Chirpy, Freezer - Thanks.

    I had already done everything in Chirpy's list (customer mail has been flowing normally to the remote machine - it was just mail from root, scripts, etc. that was not arriving).

    The fix, it turned out, was that on the mail server, I had the other machine's main domain listed but not hostname.domain. Since mail from root is sent from hostname.domain.com rather than just domain.com, adding the full name to /etc/localdomains on the mail server fixed it.

    Appreciated.
     
  5. anup123

    anup123 Well-Known Member

    Joined:
    Mar 29, 2004
    Messages:
    897
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    This Planet
    Hello Chirpy,

    Brief outline (if possible) for following:

    Machine 1: cPanel (Linux)
    Machine 2: Plesk (Windows)

    All mail handling for Machine 2 (wrt virus scanning, spam scan etc) preferred to be handled by Machine 1 (would not mind all DNS to be handled by Machine 1). Same for both incoming and outgoing mails.

    Machine 1 is high end so would prefer to have a lower spec hardware (cpu/ram) for machine2 as aa starting point.

    Short intro/steps to the above

    Cheers
    Anup
     
    #5 anup123, Oct 17, 2005
    Last edited: Oct 17, 2005
  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
    That can be achieved using smart routers, MX record changes and relaying options:

    1. You would point the MX records for the domains on Machine2 to an A record pointing to an IP address on Machine1

    2. On Machine1 you need to setup a smart router that will process the email for Machine2 and then forward it on to Machine2:

    http://forums.cpanel.net/showthread.php?p=162075#post162075

    3. I don't recall, but you may have to setup the server to allow relaying of the email oetherwise it will reject the email. If so, you should add the domains you ish to relay into /etc/localdomains
     
  7. anup123

    anup123 Well-Known Member

    Joined:
    Mar 29, 2004
    Messages:
    897
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    This Planet
    Thanks.
    I shall perhaps look forward to your services when i signup for windows box. Currently hunting ... including my prsent service provider with whom i have the linux box as they are pretty good ... offered a free hardware upgrade after almost two years with them with no increase in rentals.

    Cheers
    Anup
     
Loading...

Share This Page