A few people requested a description of how I collect and send the mail
from my laptop, a 486 running RedHat Linux 5.2, over SSH tunnels.
...No problems with authenticated relaying here. :-)
Feel free to email me with additional questions on my setup.
Glenn Strauss
<[EMAIL PROTECTED]>
Server requirements: (i.e. the pop server to which you connect)
MTA (any)
SSH which allows user logins
Required packages: (on the client machine)
qmail http://www.qmail.org/
serialmail ftp://koobera.math.uic.edu/www/serialmail.html
fetchmail http://www.tuxedo.org/~esr/fetchmail/
ssh http://www.ssh.fi/
Basically, follow the instructions that come with each package. I compiled
and installed the packages using default settings, and configured qmail to
catch all outgoing mail in a maildir ~alias/pppdir, as recommended by
serialmail docs. Also, to avoid being prompted by ssh for a password you
must set up a ~/.ssh/identity for RSA authentication.
The only non-standard thing I did was modify /usr/local/bin/maildirsmtp,
which I included below. I changed the port number from 25 (standard SMTP)
to 1111 because I run my own qmail-smtpd on port 25 and want to send mail
out to the remote server's smtp port 25. Port 1111 is just an arbitrary
free port on my machine over which I chose to use ssh to tunnel the
relayed mail; port 1111 on my machine is effectively port 25 on the remote
server.
> /usr/local/bin/maildirsmtp
#!/bin/sh
# WARNING: This file was auto-generated. Do not edit!
exec \
/usr/local/bin/maildirserial -b -t 1209600 -- "$1" "$2" \
tcpclient -RHl0 -- "$3" 1111 \
/usr/local/bin/serialsmtp "$2" "$4"
I run 'fetchmail', which uses my .fetchmailrc (below), in
/etc/ppp/ip-up.local each time I dial in, and I run 'upload-mail' (below)
before I shut down the ppp connection. Each time ssh is invoked below, it
makes the connection and issues the command 'sleep 10' on the remote
machine, giving the fetchmail or maildirsmtp process 10 seconds (ample
time) to set up its own secure connection, before the original ssh
connection is closed.
> /root/.fetchmailrc
# .fetchmailrc
defaults
forcecr
poll localhost protocol pop3 port 1111:
preconnect "ssh -C -f [EMAIL PROTECTED] -L 1111:netspace.org:110 sleep 10"
user gs is gs
pass MyPaSsWoRd
> /root/bin/upload-mail
#!/bin/sh
# use serialmail to send queued mail
ssh -C -f [EMAIL PROTECTED] -L 1111:netspace.org:25 sleep 10
/usr/local/bin/maildirsmtp ~alias/pppdir alias-ppp- localhost gs.netspace.org