Skip navigation

Tag Archives: ssh

At my office, the ISP blocks all SMTP servers except for theirs… problem is, for some reason my account can’t send email! So I have to end up using webmail (ick), or hack my way around it. It’s very handy to have an SSH server or two lying around. If you do, you can just create an SSH tunnel to your SMTP server, and send your email through that!

I wrote a quick little script to run when you find yourself in this situation: just make sure to run it with admin privileges. Your email client won’t even know the difference!

sudo ./


cp /etc/hosts /etc/hostsBackupSMTP
echo " []" >> /etc/hosts
ssh [username]@[] -L 25:[]:25

#restore once the tunnel is broken
cp /etc/hostsBackupSMTP /etc/hosts