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.

SSH Tunnel for Backoffice Exchange server

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

  1. godcandy2003

    godcandy2003 Member

    Joined:
    Apr 22, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    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> (mailserver.com) [99.157.1.169] F=<email@domain.com> temporarily rejected RCPT <email@domain.com>: 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

    Brad
     
  2. godcandy2003

    godcandy2003 Member

    Joined:
    Apr 22, 2011
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    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.

    smarthost:
    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
    no_more

    remote_smtp_smarthost:
    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: 127.0.0.1

    If you telnet 127.0.0.1 2525 you get the following

    root@V1 [~]# telnet 127.0.0.1 2525
    Trying 127.0.0.1...
    Connected to localhost (127.0.0.1).
    Escape character is '^]'.
    220 Exchange-Server.domain.local Microsoft ESMTP MAIL Service ready at Mon, 25 Apr 2011 08:38:02 -0500
    quit
    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 == brad@domain.com 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.

    Brad
     
Loading...

Share This Page