Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 43
  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    1

    Default Mailertable equi

    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. #2
    Member
    Join Date
    Aug 2003
    Location
    United Kingdom
    Posts
    186

    Default

    Did you find a solution?

  3. #3
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Not tried it, but I guess you could use a smart router in exim:
    http://www.exim.org/exim-html-4.40/d...20.html#IX1704
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  4. #4
    Member
    Join Date
    Aug 2003
    Location
    United Kingdom
    Posts
    186

    Default

    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. #5
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Excellent! Well done thank you for posting the implementation too.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  6. #6
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Dec 2004
    Posts
    392

    Default

    Wow.. works like a charm.

    Thanks very much for the BRILLIANT post...

    Cheers
    A ndy

  7. #7
    Member
    Join Date
    Jun 2004
    Posts
    23

    Default

    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. #8
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    I'm not 100% sure, but it most likely would queue it for later delivery.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  9. #9
    Member
    Join Date
    Nov 2004
    Posts
    13

    Default

    Quote Originally Posted by projectandrew
    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
    etc etc

    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. #10
    Member
    Join Date
    Jun 2004
    Posts
    23

    Default

    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. #11
    Member
    Join Date
    Nov 2004
    Posts
    13

    Default

    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. #12
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    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?
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  13. #13
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Dec 2004
    Posts
    392

    Angry

    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}}
    UK Managed Hosting
    UK Linux Support
    The information given above is intended to be advice only.

  14. #14
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Dec 2004
    Posts
    392

    Default

    nope looks like using static_route and smart_route do NOT scan email for spam...

    anyoen know how to ge tthat to work ?
    UK Managed Hosting
    UK Linux Support
    The information given above is intended to be advice only.

  15. #15
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Dec 2004
    Posts
    392

    Question

    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}}
    UK Managed Hosting
    UK Linux Support
    The information given above is intended to be advice only.

Similar Threads & Tags
Similar threads
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube