NAME

leafmail - minimal spooling SMTP server

SYNOPSIS

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

DESCRIPTION

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.

INSTALLATION

To install leafmail ...

  1. You need a full Perl 5.004 (or higher) installation, including the modules NetServer::Generic (0.02 or higher) and NetServer::SMTP (0.01 or higher), and all the modules they depend on.

  2. You also need the Perl modules Data::Dumper and Mail::Internet, both available from CPAN. If they aren't installed, you can't run leafmail.

  3. Make sure the hash-bang line at the top of the 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.

  4. Edit your copy of leafmail.cf, the 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).

  5. Create some method for starting/stopping 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).

  6. Test 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.

BUGS

Probably loads of them. leafmail is a work in progress, and this is the first alpha release. Caveat programmer!

AUTHOR

Charlie Stross <charlie@antipope.org>.