port forwarding

Live forum: /viewtopic.php?t=229


31-03-2008 14:47:12

I have successfully setup ssh port forwarding with a command like this:

ssh -p<port> -D8080 -f -q -C -N my.home.machine

and I can use localhost:8080 as a SOCKS proxy in firefox successfully. (woot!!)

However, the real goal is to get IMAP through the tunnel. One suggestion (from last SIG) was to use ssh -p<port> -L 143:my.home.machine:143 and use squid to proxy that from my.home.machine to my.email.machine. However, I haven't found the correct incantation for squid, and it looks like squid wouldn't understand how to forward IMAP anyway. As a second bummer, the ssh command would have to be run as root since it won't let me forward privileged ports (duh!).

So, are there good solutions to talk to my.email.machine with an ssh tunnel? How can you do it with squid or maybe stunnel?

Note, I have to run ssh with the -p <port> parameter since outgoing ssh is blocked at work.

perhaps Wolfie will make a comment....


31-03-2008 17:20:31

Sorry to leave you hanging on this.....should really start looking at my gmail account more often :)

I use squid on many different protocols so using imap, pop3, pop3s, imaps, instant messaging, etc. should not pose a problem.

Just add this line near where port 80, etc is defined:

acl Safe_ports port 143 #imap
acl Safe_ports port 993 #imaps

Squid really will allow you to proxy any protocol.


01-04-2008 09:57:59

ok, the SafePort thing allows squid to proxy, but how do I get the it hooked up to the imap box?

box@work -> firewall/proxy@work -> ssh/squid@home ???? imap@mailserver

Does it do it automatically?