« Catching Up ... | Main | You know you're a Pats fan ... »

January 29, 2004

Avoiding Mail Blocking Firewalls

Due to recent issues with virii and the like, the IT staff at work has disallowed external pop and smtp. Well, that just sucks for me who has all personal e-mail sent off-site for a reason. So, I figured subversion was necessary. SSH forwarding is a beautiful thing. If you have a server you can ssh to and see the pop or smtp server you are looking for, you can run this script to port forward your connections locally to the desired servers after adjusting the variables at the top. Then, all you need to do is add an entry for your mail server in /etc/hosts that points to 127.0.0.1. Done!

#!/bin/sh
 
# Set up Variables
 
# Mail Server
MAILSERVER=mail.domain.com
 
# SSH Server / User
SSHSERVER=shell.domain.com
SSHUSER=myuser
 
# IMAP Port
# 143 - Standard IMAP | 993 - SSL IMAP
IMAPPORT=993
 
# POP Port
# 110 - Standard Pop | 995 - SSL POP
POPPORT=110
 
# SMTP Port
# 25 - Standard SMTP | 465 - SSL SMTP
SMTPPORT=25
 
# SSH Commands
ssh -fL ${SMTPPORT}:${MAILSERVER}:${SMTPPORT} ${SSHUSER}@${SSHSERVER} tail -f /dev/null
ssh -fL ${IMAPPORT}:${MAILSERVER}:${IMAPPORT} ${SSHUSER}@${SSHSERVER} tail -f /dev/null
ssh -fL ${POPPORT}:${MAILSERVER}:${POPPORT} ${SSHUSER}@${SSHSERVER} tail -f /dev/null

Posted by Skadz at January 29, 2004 12:15 PM

Trackback Pings

TrackBack URL for this entry:
http://www.skadz.com/mt-tb.cgi/27

Listed below are links to weblogs that reference Avoiding Mail Blocking Firewalls:

» Avoid Mail Blocking Firewalls from geekmail
Avoid Mail Blocking Firewalls shows how to get around locked down firewalls. For Mac OS X and Unix geeks! [Read More]

Tracked on January 29, 2004 8:20 PM

Comments

After an hour of googling, this was exactly what I was looking for. Thanks.

Posted by: Jon at June 3, 2004 3:35 PM