Re: [exim] SMTP and ports 25 and 1025; was "smtp through a s…

Pàgina inicial
Delete this message
Reply to this message
Autor: Renaud Allard
Data:  
A: Easthope
CC: exim-users
Assumpte: Re: [exim] SMTP and ports 25 and 1025; was "smtp through a ssh ..."


Easthope wrote:
> Folk,
>
> At Wed, 14 Mar 2007 23:26:46 +0100, Magnus Holmgren said,
> "If you're tunneling *from* a unix-type OS as a normal user, you
> can't use
> listen on port 25 since it's privileged."
>
> Ah!
>
> Mail is received via POP3, port 110 with no trouble.
>
> I am tunneling to Debian Linux for sending mail via
> SMTP. So apparently the problem is that the exim
> daemon is not allowed to receive messages at 25
> through a user tunnel?
>
> So this might make a working tunnel?
>
> SSH.StartForwarding peter@??? 25:localhost:1025 ~
>
> Or perhaps root should make the tunnel?
>
> SSH.StartForwarding root@??? 25:localhost:25 ~
>


For SMTP/IMAP on linux, this works very well an you don't have to change
the inner network configuration. It works like if you were on the lan,
even with the real Ip of the server

sudo ifconfig lo:0 yourserverip netmask 255.255.255.255
sudo iptables -t nat -A OUTPUT -d yourserverip -p tcp --dport 143 -j
DNAT --to yourserverip:8993
sudo iptables -t nat -A OUTPUT -d yourserverip -p tcp --dport 25 -j DNAT
--to yourserverip:2525
ssh me@mygateway -L yourserverip:2525:yourserverip:25 -L
yourserverip:8993:yourserverip:143