Skip to content

Instantly share code, notes, and snippets.

@tlatsas
Created September 9, 2011 12:15
Show Gist options
  • Save tlatsas/1206063 to your computer and use it in GitHub Desktop.
Save tlatsas/1206063 to your computer and use it in GitHub Desktop.
tunel gmail imap though your server
#!/bin/sh
# Tunnel imap connection through your server
_server="your-server-here"
_port="your-server-port-here"
_username="your-server-login-name"
# tunnel gmail imap (imap.gmail.com:993) <-> (localhost:10993)
ssh -f -N -L localhost:10993:imap.gmail.com:993 -p ${_port} -l ${_username} ${_server}
# tunnel gmail smtp (smtp.gmail.com:587) <-> (localhost:10587)
ssh -f -N -L localhost:10587:smtp.gmail.com:587 -p ${_port} -l ${_username} ${_server}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment