
leafmail - minimal spooling SMTP server

A minimal SMTP server intended for leaf sites connected to the internet via an intermittent dial-up connection.

When running as a standalone daemon leafmail listens for incoming local SMTP traffic.
When it receives mail,
it spools it in a local spool directory.
When a dialup connection is available,
leafmail may be run as a command-line application (rather than a daemon); each file named on the command line is then read in and transmitted to the smarthost,
and removed from the spool directory.
In addition,
if leafmail is run as /usr/lib/sendmail,
it reads a mail message from its standard input and spools it (to simulate sendmail's spooling mechanism).
Leafmail has no local delivery mechanism; the only thing it can do with mail is send it to an upstream server.
It cannot deliver mail locally.
This is not as useless as it sounds.
Many dialup internet users collect incoming mail via POP3,
but have to send it via SMTP to their ISP's server.
Leafmail fits in this gap by providing a local SMTP-spooling service for such sites.
Leafmail has been tested with Pine (SMTP connection) and mutt (standard input to sendmail).
Other MUAs may have quirks I haven't been bitten by yet; expect leafmail to evolve rapidly from this alpha-release.
I would be very surprised indeed to hear that leafmail runs on a non- UNIX operating system.
To install leafmail ...
NetServer::Generic (0.02 or higher) and NetServer::SMTP (0.01 or higher),
and all the modules they depend on.Data::Dumper and Mail::Internet,
both available from CPAN.
If they aren't installed,
you can't run leafmail.leafmail script points to your copy of Perl.
chmod leafmail to executable,
chown it to mail,
and stick it in /usr/sbin or somewhere similar.leafmail configuration file.
Put it in /etc and make sure it's readable by leafmail (but not writable by non-privileged users!).
Ensure that the spool directory indicated in leafmail.cf exists and is readable,
writable,
and executable by the owner of the leafmail program (i.e.
probably the UID mail).leafmail.
This will typically be a line in /etc/rc.local (for BSD-ish systems) or a custom script in /etc/rc.d/init.d (for SVR-ish systems).leafmail.
You should probably do this by telling leafmail.cf to use a non-standard port for sessions (e.g.
9000) rather than port 25,
then telnet to that port and interactively enter SMTP commands.
If this works,
switch to port 25,
ensure that no other SMTP server (e.g.
qmail,
sendmail) is running,
then restart leafmail.
Probably loads of them.
leafmail is a work in progress,
and this is the first alpha release.
Caveat programmer!

Charlie Stross <charlie@antipope.org>.