IntroductionThis method was suggested for SMTP servers that do not allow connections from localhost. Since the SSH tunnel normally connects to the SMTP server via SSH, then attempts to connect to the SMTP daemon, the connection appears as though it is from localhost. The exact email that pointed out the problem was: I have been using this [ssh
tunneling] method for a several months and one day it came
unstuck. My hosting service provider which I was using for POP and SMPT (via the ssh tunnel) changed something at their end and the SMPT server stopped accepting mail from their localhost. I'm not sure if it was deliberate or not. So I had to find another way to get mail out ! I am now using the "sendmail" transport via ssh, which might be even more secure than SMPT because it doesn't open any ports on your local machine. Perhaps others would be interested ? Prerequisites
Shell ScriptsA simple shell script will be required. The script connects to the remote mail server and directly executes sendmail on that server, therefore not attempting to connect to the sendmail daemon. Download the script and make it executable, chmod u+x sshsendmail.sh. Open the script in an editor (kwrite), and edit the variables SSH_USERNAME and SSH_SERVER. The username should be the username that you use to open an ssh connection to the mail server. This may not be the same as your POP3 or SMTP username. The mail server is the domain name (or IP) of your mail server. For now, it is assumed that the mail server is running the SSH daemon. |
Launch KMail. Open the
configuration dialog by clicking Settings->Configure
KMail. Click on the second icon in the configuration dialog, the Network settings. Add a Sendmail transport and change the "Location" field to /path/to/sshsendmail.sh |
(Click to Enlarge) |