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.

Mailertable equi

Discussion in 'E-mail Discussions' started by switala, Dec 21, 2003.

  1. switala

    switala Registered

    Joined:
    Dec 20, 2003
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    How do I setup relays for a domain in CPanel. Just like I always do in the /etc/mail/mailertable in Sendmail.

    I have a domain's email that I have to relay to a private IPAddress on the internal network

    domain.com smtp:[192.168.0.9]

    Thank you
     
  2. projectandrew

    projectandrew Well-Known Member

    Joined:
    Aug 27, 2003
    Messages:
    185
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    United Kingdom
    Did you find a solution?
     
  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
  4. projectandrew

    projectandrew Well-Known Member

    Joined:
    Aug 27, 2003
    Messages:
    185
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    United Kingdom
    Just cracked it - spent the afternoon trawling around google, and finally pieced together this solution - a quick how-to:

    1. Type the following when logged in via SSH

    Code:
    touch /etc/staticroutes
    pico /etc/staticroutes
    2. Add entries in the format:

    Code:
    domainname.com: target.mail.server
    3. Press CTRL-O to save the file, then CTRL-X to exit the pico editor.

    4. In WHM, under 'Service Configuration' choose 'Exim Configuration Editor', then click 'Switch to Advanced Editor'.

    5. Scroll down to the 'ROUTERS CONFIGURATION' section, and in the white space underneath, add the following:

    Code:
    static_route:
      driver = manualroute
      transport = remote_smtp
      route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}
    6. Scroll to the bottom of the page and click 'Save' - Exim will automatically restart.

    Well chuffed, since I can now route mail for some of my customers domains, once they've been scanned for viruses and spam on my cpanel servers (I use the RVSKin virus/spam solution/howto), to their Exchange servers...
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Excellent! Well done :) thank you for posting the implementation too.
     
  6. forlinuxsupport

    forlinuxsupport Well-Known Member
    PartnerNOC

    Joined:
    Dec 22, 2004
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Wow.. works like a charm.

    Thanks very much for the BRILLIANT post... :) :)

    Cheers
    A ndy :)
     
  7. NetBlaster

    NetBlaster Member

    Joined:
    Jun 12, 2004
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    What happens if the remote mail server is down? Does the mail accumulate on the source server until the remote server becomes available?

    Ron...
     
  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
    I'm not 100% sure, but it most likely would queue it for later delivery.
     
  9. Acieke

    Acieke Member

    Joined:
    Nov 13, 2004
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1

    I also posted a post on this, and I was told to search for smart routers. It seems to work just fine, until I specify the port number; then I get:
    2005-12-14 22:25:16 1Eme7f-0004EB-TZ == xxx@xxx R=static_route T=remote_smtp defer (22): Invalid argument
    Anyways, I have to forward mail to another port too; any possibilities on that ?

    Thanks
     
  10. NetBlaster

    NetBlaster Member

    Joined:
    Jun 12, 2004
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    I'm sure I got this from chirpy but this is what I'm doing and it works perfect.


    ROUTERS
    Code:
    smart_route:
      driver = manualroute
      route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}
      transport = remote_smtp_smart
    

    TRANSPORTS
    Code:
    remote_smtp_smart:
      driver = smtp
      port = 6625
      hosts = ${lookup{$domain}lsearch{/etc/staticroutes}}
      hosts_override
    
     
  11. Acieke

    Acieke Member

    Joined:
    Nov 13, 2004
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Okay, thanks for that, I added the second code block, changing 6625 to the port of the destination mail server..
    But now I get the following error for all queued and new sent messages:
    2005-12-15 14:30:44 1Em8pc-0001lO-6H == xxx@xxx R=static_route T=remote_smtp defer (-53): retry time not reached for any host


    Any ideas?
    Thanks
    Frederic
     
  12. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    The error would suggest that exim is not able to connect from your server to the remote IP on that port. Have you tried logging into the cPanel server and using:

    telnet ip-of-server 6625

    Make sure that you get the SMTP banner. type quit to end the session.

    If that works, then perhaps you don't have the correct details in your /etc/staticroutes file?
     
  13. forlinuxsupport

    forlinuxsupport Well-Known Member
    PartnerNOC

    Joined:
    Dec 22, 2004
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Sorry to open an old post.

    Will the steps below get cpanel server to accept mail and scan it for spam and then relay it on ?

    ROUTERS
    Code:

    Code:
    smart_route: 
                 driver = manualroute
                 route_data = ${lookup{$domain}lsearch{/etc/staticroutes}} 
                 transport = remote_smtp_smart


    TRANSPORTS
    Code:

    Code:
    remote_smtp_smart: 
                    driver = smtp 
                    port = 6625 
                    hosts = ${lookup{$domain}lsearch{/etc/staticroutes}} 
                    hosts_override
    
    Ive got this in routes and it DOESNT scan the email it just relays it on fine.

    ROUTERS
    Code:
    static_route:
      driver = manualroute
      transport = remote_smtp
      route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}
     
  14. forlinuxsupport

    forlinuxsupport Well-Known Member
    PartnerNOC

    Joined:
    Dec 22, 2004
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    nope looks like using static_route and smart_route do NOT scan email for spam...

    anyoen know how to ge tthat to work ?
     
  15. forlinuxsupport

    forlinuxsupport Well-Known Member
    PartnerNOC

    Joined:
    Dec 22, 2004
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    I got this direct from cpanel to make the relaying server also scan the emails.

    This can be done simply by adding the aforementioned condition to the static_route router, which is presently defined in your exim configuration:

    static_route:
    driver = manualroute
    condition = "${perl{checkspam}}"
    transport = remote_smtp
    route_data = ${lookup{$domain}lsearch{/etc/staticroutes}}
     
  16. dinfiesta

    dinfiesta Well-Known Member

    Joined:
    May 2, 2005
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    How do I specify all domains? (talking about point number 2)

    Thanks.
     
  17. forlinuxsupport

    forlinuxsupport Well-Known Member
    PartnerNOC

    Joined:
    Dec 22, 2004
    Messages:
    386
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hi

    Just like this.


    forlinux.co.uk: 200.0.0.56
    forlinuxhosting.co.uk: 200.0.0.57

    Just list all of them on right and ip on left :) bit of command line scripting :)


    Left = domain hosted on the server that you want to do the forwarding on.

    IP / Domain on right = address of server you want to relay to (e.g. exchnage server)

    Regards
    Andy
     
  18. WestBend

    WestBend Well-Known Member

    Joined:
    Oct 12, 2003
    Messages:
    173
    Likes Received:
    0
    Trophy Points:
    16
    Just an addendum to this thread.

    You MAY need to alter your exim_outgoing.conf with the same router info. Maybe thats a given but everyone seems to only mention exim.conf and it took me days to realize it needed to go into the outgoing.conf
     
    #18 WestBend, Oct 20, 2006
    Last edited: Oct 20, 2006
  19. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    So long as you correctly put add the router information to the exim configuration editor, then /scripts/mailscannerupdate will automatically copy the static router code into both exim.conf and exim_outgoing.conf - you should never need to edit exim_outgoing.conf (or exim.conf for that matter).
     
  20. WestBend

    WestBend Well-Known Member

    Joined:
    Oct 12, 2003
    Messages:
    173
    Likes Received:
    0
    Trophy Points:
    16
    I hadn't updated my prior post yet. I was using a set of instructions from the web which had me directly altering the exim.conf however i did not know that editing it via WHM actually updated multiple conf files i.e. exim.conf and exim_outgoing.conf. When i followed the instructions exactly and went through WHM it was very simply :).
     
Loading...

Share This Page