Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'better yet.....' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
better yet.....
Authored by: darin on Aug 01, '03 02:20:56PM

If you are going to be using ssh, anyway, use this lesser known feature of ssh and you can use the Mail.app on your laptop to access the mail through your home network as though you were sitting on the network in your home. That way, you can send and receive mail normally.

Do this from the command line:
ssh -L -N 1234:addressofpopserver:110 addressofhomecomputer
ssh -L -N 5678:addressofsmtpserver:25 addressofhomecomputer

Then, change the pop and smtp server info in Mail.app to localhost and the respective ports from 110 to 1234 and 25 to 5678 (any reasonable port should work here -- just be consistent with the ssh command).

This will tunnel all your pop and smtp traffic through the secure ssh tunnel to your machine at home. The ISP will think you are on your home network, and mail will just work.

If you're behind a firewall in a hotel or job that blocks ports 110 and 25, then choose something else that is open and not being used on your home computer and specify it in the ssh command, thusly (assuming port 443 is open to ssh traffic):

ssh -L -N -p443 1234:addressofpopserver:110 addressofhomecomputer
ssh -L -N -p443 5678:addressofsmtpserver:25 addressofhomecomputer

Now, if I could only figure out how to change the mail server and port info in Mail.app with an applescript, I could do all of this in an applescript.

Also, if there's anyone having luck with ipfw and port forwarding, you could theoretically do all this with the port forwarding rules and leave the Mail.app settings alone, but I haven't been able to make it work yet. Here's my best attempt so far, but it doesn't work:

sudo ipfw add 1234 fwd 127.0.0.1,1234 tcp from any to any 110
Anyone see why not?

[ Reply to This | # ]