Go to file
Devin Carraway 8bb7cf67de Add a caution about using large wait times in check_earlytalker; some
superficial research suggests that some MTAs have unexpectedly short timeouts
waiting for SMTP greetings (default of 30sec for Exim4.5, most notably)


git-svn-id: https://svn.perl.org/qpsmtpd/trunk@534 958fd67b-6ff1-0310-b445-bb7760255be9
2005-07-30 07:19:17 +00:00
config.sample r547@jpeacock: jpeacock | 2005-07-02 07:20:17 -0400 2005-07-09 11:03:53 +00:00
lib Migrate transaction(), reset_transaction() and connection() up to Qpsmtpd.pm 2005-07-29 18:05:08 +00:00
log Add -p to mkdir in log/run (Rasjid Wilcox <rasjid@openminddev.net>) 2002-11-20 10:15:06 +00:00
plugins Add a caution about using large wait times in check_earlytalker; some 2005-07-30 07:19:17 +00:00
t MERGE 503:505 FROM https://svn.perl.org/qpsmtpd/branches/0.31 2005-07-14 13:31:07 +00:00
Changes return 500 rather than 521 for DENY in the unrecognized_command hook 2005-07-06 22:22:29 +00:00
CREDITS Fix off-by-one line numbers in warnings from plugins (thanks to 2005-05-05 07:44:34 +00:00
LICENSE update the MANIFEST 2005-07-02 02:08:37 +00:00
Makefile.PL Update PREREQ_PM 2005-07-06 19:09:07 +00:00
MANIFEST r521@bear: rspier | 2005-07-19T03:24:18.553459Z 2005-07-19 03:24:42 +00:00
MANIFEST.SKIP MANIFEST details added (so building a package is easier) 2004-09-05 16:45:05 +00:00
qpsmtpd MERGE r386:r480 FROM https://svn.perl.org/qpsmtpd/branches/high_perf 2005-07-11 19:10:49 +00:00
qpsmtpd-forkserver Fix for forkserver breakage 2005-07-13 17:10:38 +00:00
README Remove some changes cruft (it's in Changes after all) 2005-07-06 19:06:01 +00:00
README.logging Revamp Qpsmtpd::Constants so it is possible to retrieve the text 2005-03-29 20:15:53 +00:00
README.plugins r491@dog: rspier | 2005-07-07 20:32:53 -0700 2005-07-08 03:37:09 +00:00
run pass -R to tcpserver 2003-03-18 09:46:52 +00:00
STATUS lowercase distribution name 2005-07-06 14:31:37 +00:00

#
#  this file is best read with `perldoc README`
#

=head1 NAME

Qpsmtpd - qmail perl simple mail transfer protocol daemon

web:
  http://smtpd.develooper.com/

mailinglist:
  qpsmtpd-subscribe@perl.org


=head1 DESCRIPTION

What is Qpsmtpd?

Qpsmtpd is an extensible smtp engine written in Perl.  No, make that
easily extensible!  See plugins/quit_fortune for a very useful, er,
cute example.


=head2 What's new in this release?

See the Changes file! :-)


=head1 Installation

=head2 Required Perl Modules

The following Perl modules are required:
   Net::DNS
   MIME::Base64
   Mail::Header (part of the MailTools distribution)

If you use a version of Perl older than 5.8.0 you will also need
   Data::Dumper
   File::Temp
   Time::HiRes

The easiest way to install modules from CPAN is with the CPAN shell.
Run it with

  perl -MCPAN -e shell

=head2 qpsmtpd installation

Make a new user and a directory where you'll install qpsmtpd.  I
usually use "smtpd" for the user and /home/smtpd/qpsmtpd/ for the
directory.

Put the files there.  If you install from Subversion you can just do
run the following command in the /home/smtpd/ directory.

   svn co http://svn.perl.org/qpsmtpd/trunk .

Or if you want a specific release, use for example

   svn co http://svn.perl.org/qpsmtpd/tags/0.30 .

In the branch L<http://svn.perl.org/qpsmtpd/branches/high_perf/> we
have an experimental event based version of qpsmtpd that can handle
thousands of simultaneous connections with very little overhead.

chmod o+t ~smtpd/qpsmtpd/ (or whatever directory you installed qpsmtpd
in) to make supervise start the log process.

Edit the file config/IP and put the ip address you want to use for
qpsmtpd on the first line (or use 0 to bind to all interfaces).

If you use the supervise tools, then you are practically done now!
Just symlink /home/smtpd/qpsmtpd into your /services (or /var/services
or /var/svscan or whatever) directory.  Remember to shutdown
qmail-smtpd if you are replacing it with qpsmtpd.

If you don't use supervise, then you need to run the ./run script in
some other way.

The smtpd user needs write access to ~smtpd/qpsmtpd/tmp/ but should
not need to write anywhere else.  This directory can be configured
with the "spool_dir" configuration.

As per version 0.25 the distributed ./run script runs tcpserver with
the -R flag to disable identd lookups.  Remove the -R flag if that's
not what you want.


=head2 Configuration

Configuration files can go into either /var/qmail/control or into the
config subdirectory of the qpsmtpd installation.  Configuration should
be compatible with qmail-smtpd making qpsmtpd a drop-in replacement.

If qmail is installed in a nonstandard location you should set the
$QMAIL environment variable to that location in your "./run" file.

If there is anything missing, then please send a patch (or just
information about what's missing) to the mailinglist or to
ask@develooper.com.


=head1 Better Performance

As of version 0.21 qpsmtpd supports "PPerl"
http://search.cpan.org/search?dist=PPerl

"PPerl turns ordinary perl scripts into long running daemons, making
subsequent executions extremely fast. It forks several processes for
each script, allowing many processes to call the script at once."

Running under PPerl is easy - just change your "run" file to contain
the following command:

  pperl -Tw -- --prefork=$MAXCLIENTS --maxclients=$MAXCLIENTS \
    --no-cleanup ./qpsmtpd 2>&1

As an alternative to PPerl (some users find PPerl unstable) we recommend using
the forkserver. This forks for every connection, but pre-loads all the plugins
to reduce the overhead.

=head1 Plugins

The qpsmtpd core only implements the SMTP protocol.  No useful
function can be done by qpsmtpd without loading plugins.

Plugins are loaded on startup where each of them register their
interest in various "hooks" provided by the qpsmtpd core engine.

At least one plugin MUST allow or deny the RCPT command to enable
receiving mail.  The "check_relay" plugin is the standard plugin for
this.  Other plugins provides extra functionality related to this; for
example the require_resolvable_fromhost plugin described above.


=head1 Configuration files

All the files used by qmail-smtpd should be supported; so see the man
page for qmail-smtpd.  Extra files used by qpsmtpd includes: 

=over 4

=item plugins

List of plugins, one per line, to be loaded in the order they
appear in the file.  Plugins are in the plugins directory (or in
a subdirectory of there).


=item rhsbl_zones
 
Right hand side blocking lists, one per line. For example:

    dsn.rfc-ignorant.org does not accept bounces - http://www.rfc-ignorant.org/

See http://www.rfc-ignorant.org/ for more examples.


=item dnsbl_zones

Normal ip based dns blocking lists ("RBLs"). For example:

  relays.ordb.org
  spamsources.fabel.dk


=item require_resolvable_fromhost
         
If this file contains anything but a 0 on the first line, envelope
senders will be checked against DNS. If an A or a MX record can't be
found the mail command will return a soft rejection (450).


=item spool_dir

If this file contains a directory, it will be the spool directory
smtpd uses during the data transactions. If this file doesnt exist, it
will default to use $ENV{HOME}/tmp/. This directory should be set with
a mode of 700 and owned by the smtpd user.


=item everything (?) that qmail-smtpd supports. 

In my test qpsmtpd installation I have a "config/me" file containing
the hostname I use for testing qpsmtpd (so it doesn't introduce itself
with the normal name of the server).
     
=back



=head1 Problems

In case of problems always first check the logfile.

As default it goes into log/main/current.  Qpsmtpd can log a lot of
debug information.  You can get more or less by adjusting $TRACE_LEVEL
in lib/Qpsmtpd.pm (sorry, no easy switch for that yet).  Something
between 1 and 3 should give you just a little bit.  If you set it to
10 or higher you will get lots of information in the logs.

If the logfile doesn't give away the problem, then post to the
mailinglist (subscription instructions above).  If possibly then put
the logfile on a webserver and include a reference to it in the mail.