Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SSH Tunnel for Backoffice Exchange server

Discussion in 'E-mail Discussion' started by godcandy2003, Apr 22, 2011.

  1. godcandy2003

    godcandy2003 Member

    Apr 22, 2011
    Likes Received:
    Trophy Points:
    I have a client who wishes for his e-mail to be transmitted to and from my server via ssh encryption. I have been able to successfully setup a connection that works for sending e-mail and if I could get past the error message from exim would receive as well. currently my setup is as follows

    Cpanel Server < SSH Tunnel forward port 26 internal to localhost:25 external < Internal SBS Server
    This outgoing connection works great with no issues.
    Cpanel Server > SSH Tunnel forward localhost:2525 to internal 25 > Internal SBS Server
    This connection works great via Telnet but I cant get exim to forward e-mail for that one domain.

    I get this error in the exim log:
    2011-04-22 20:16:17 H=<IP ADDRESS> ( [] F=<> temporarily rejected RCPT <>: remote host address is the local host

    I know its a strange setup but i don't see why it wouldn't work. Please help

  2. godcandy2003

    godcandy2003 Member

    Apr 22, 2011
    Likes Received:
    Trophy Points:
    So I found some more info this weekend and have a new problem. The tunnel is up via telnet so what I really needed to do was to create a router in exim to handle the domain and forward the e-mail out the tunnel. Currently this is what I had in the config.

    debug_print = "R: smarthost for $local_part@$domain"
    driver = manualroute
    self = send
    # domains = ! +local_domains
    transport = remote_smtp_smarthost
    route_list = * DCsmarthost byname
    host_find_failed = defer
    same_domain_copy_routing = yes

    driver = smtp
    port = 2525
    hosts = ${lookup{$domain}lsearch{/etc/smartdomains}}
    helo_data = ${if exists {/etc/mailhelo}{${lookup{$sender_address_domain}lsearch*{/etc/mailhelo}{$value}{$primary_hostname}}}{$primary_hostname}}

    The contents of /etc/smartdomains is as follows
    <domain name>.com:

    If you telnet 2525 you get the following

    root@V1 [~]# telnet 2525
    Connected to localhost (
    Escape character is '^]'.
    220 Exchange-Server.domain.local Microsoft ESMTP MAIL Service ready at Mon, 25 Apr 2011 08:38:02 -0500
    221 2.0.0 Service closing transmission channel
    Connection closed by foreign host.

    I have several issues now. First when I added that information to my exim config it was attempting to forward all domains not just the one i asked it to.

    And all e-mail gets this error

    2011-04-25 08:15:20 1QELdC-0001Zh-3X == R=smarthost T=remote_smtp_smarthost defer (-53): retry time not reached for any host

    I compiled this configuration form numerous sources and I am sure there is something messed up I just hope there is someone out there who is more versed in exim than I am.


Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice