NetServer-SMTP
view release on metacpan or search on metacpan
examples/leafmail view on Meta::CPAN
=head1 NAME
leafmail - minimal spooling SMTP server
=head1 SYNOPSIS
A minimal SMTP server intended for leaf sites connected to the internet
via an intermittent dial-up connection.
=head1 DESCRIPTION
When running as a standalone daemon C<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, C<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 C<leafmail> is run as C</usr/lib/sendmail>, it reads a
mail message from its standard input and spools it (to simulate
C<sendmail>'s spooling mechanism).
C<Leafmail> has B<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. C<Leafmail> fits in this gap by providing a local
SMTP-spooling service for such sites.
C<Leafmail> has been tested with C<Pine> (SMTP connection) and C<mutt>
(standard input to C<sendmail>). Other MUAs may have quirks I haven't
been bitten by yet; expect C<leafmail> to evolve rapidly from this
alpha-release.
I would be very surprised indeed to hear that C<leafmail> runs on a non-
UNIX operating system.
=head2 INSTALLATION
To install C<leafmail> ...
=over 4
=item 1
You need a full Perl 5.004 (or higher) installation, including the
modules C<NetServer::Generic> (0.02 or higher) and C<NetServer::SMTP>
(0.01 or higher), and all the modules they depend on.
=item 2
You also need the Perl modules C<Data::Dumper> and C<Mail::Internet>,
both available from CPAN. If they aren't installed, you can't run
C<leafmail>.
=item 3
Make sure the hash-bang line at the top of the C<leafmail> script points
to your copy of Perl. B<chmod> C<leafmail> to executable, B<chown> it
to B<mail>, and stick it in I</usr/sbin> or somewhere similar.
=item 4
Edit your copy of I<leafmail.cf>, the C<leafmail> configuration file. Put
it in I</etc> and make sure it's readable by C<leafmail> (but not writable
by non-privileged users!). Ensure that the spool directory indicated in
I<leafmail.cf> exists and is readable, writable, and executable by the
owner of the I<leafmail> program (i.e. probably the UID B<mail>).
=item 5
Create some method for starting/stopping C<leafmail>. This will typically
be a line in I</etc/rc.local> (for BSD-ish systems) or a custom script
in I</etc/rc.d/init.d> (for SVR-ish systems).
=item 6
Test C<leafmail>. You should probably do this by telling I<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. C<qmail>,
C<sendmail>) is running, then restart C<leafmail>.
=back
=head1 BUGS
Probably loads of them. C<leafmail> is a work in progress, and this is
the first alpha release. Caveat programmer!
=head1 AUTHOR
Charlie Stross <charlie@antipope.org>.
( run in 1.595 second using v1.01-cache-2.11-cpan-71847e10f99 )