SMTP made, well, complex

If you’re at all like me, you move regularly between mutiple different networks: home, office, dialup, wifi hotspots, hotels, and, just now, any of the 15 or so wifi links I can see on the exhibition floor at LinuxWorld. For web browsing and reading mail this is normally fine, but when it comes to sending mail you often have to switch SMTP servers for each network you connect to. (This is because most ISPs only provide SMTP to machines on their network, as a spam-reduction measure. Move to another service provider and your home SMTP server probably won’t want to talk to you.)

There are ways around this. If you’re lucky enough to have an email server that supports authentication it’ll probably let you connect from anywhere, but not many do, and not all email clients support it.

I’ve found a solution which works well for me. If you have a machine somewhere that you can connect to using SSH, you can arrange to forward a port on your local machine over that link to whatever SMTP server that remote machine uses. Then you just tell your mail client to use ‘localhost’ as the SMTP server, regardless of which network you’re on. If you’re not familiar with SSH the details are a little tricky to describe here – email me for more info – but on OS X I’ve found a neat little app called SSHTunnelManager which makes it trivial to make and break the link.

Enjoyed this post? Why not sign up to receive Status-Q in your inbox?

© Copyright Quentin Stafford-Fraser