If you are connected with a network that forbids e-mail traffic but allows SSH, you can tunnel your e-mail connection through a trusted, intermediary server:
sudo ssh -i /home/local-user/.ssh/local-user.key -L 143:mail-server.tld:143 remote-user@trusted-server.tld
Explanation for the command above:
| sudo
| Secure ports may only be forwarded by root |
| ssh -i /home/local-user/.ssh/local-user.key
| Private half of your SSH key for the trusted server |
| -L 143:mail-server.tld:143
| Forward connections to port 143 on your mail server mail-server.told
to port 143 on localhost
. Check your e-mail settings to see which port you are using to receive e-mail. |
| remote-user@trusted-server.tld
| User and hostname of a trusted, intermediary server |
You can now tell your e-mail client to receive e-mail from localhost
instead of mail-server.tld
. You will get a certificate warning.