All files in this package except those in the "cdb-0.75" subdirectory are licensed under the GPL (v2.0, see below). Those in the "cdb-0.75" subdirectory are public domain and were created by D. J. Bernstein, see the README in that subdirectory.
Copyright (C) 2004-2005,2011 Peter Conrad <conrad@tivano.de>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
qmail-spp (http://qmail-spp.sf.net/) is a patch for D. J. Bernstein's "qmail" MTA package. The patch enables "plugin" programs to be run at various stages during an SMTP protocol exchange.
This package implements a qmail-spp-style plugin that performs certain checks on the user part of envelope recipient addresses. In particular, if the domain part of the envelope recipient indicates that the mail should be delivered locally, it checks if user exists locally and if not rejects the mail.
First, the plugin checks if the recipient address user@domain
should be checked at all by looking at the RELAYCLIENT
environment
variable and comparing the domain part of the address to the domains
listed in control/locals
. If RELAYCLIENT
is set or
the domain is not listed in control/locals
, it exits immediately.
If control/virtualdomains
exists and domain is listed in
it, the plugin exits as well (assuming the local user for handling the virtual
domain is set up properly).
If the environment variable LUCHECK_FFDB
is set, it uses its
contents as the pathname of a
fastforward style database. If
the database contains user, it accepts the address and exit.
It repeats the following steps:
$LUCHECK_ALIASDIR/.qmail-user
exists, it accepts
the address and exits.If the address has not yet been accepted at this point, it is rejected with an error message.
If the environment variable LUCHECK_DEBUG
is set (to any value)
some debugging output will be sent to wherever your qmail-smtpd logs are
written. Also, if the recipient is rejected, it will be rejected with a
temporary (4xy) SMTP response code instead of a permanent (5xy)
code.
If the environment variable LUCHECK_VERBOSE
is set (to any value),
rejected addresses will be logged.
The current implementation (with only minor modifications) has been in use on a productive system for several years now and can be considered stable.
This package should be available at http://www.unix-ag.uni-kl.de/~conrad/lucheck/lucheck-spp-1.0.tar.gz
The sources are managed using the GNU Arch revision control system. You can check out a copy using
tla register-archive conrad@tivano.de--2004 \ http://www.unix-ag.uni-kl.de/~conrad/Archives/conrad@tivano.de--2004 tla grab http://www.unix-ag.uni-kl.de/~conrad/lucheck/releases--1.0
Here's my PGP-keys if you want to check the signatures.
Simply unpack the sources and type make
in the top-level directory
of the distribution. This will create a subdirectory ,,build
, in
which the build will take place.
Hint: apparently you need GNU make, which may be installed under a different name on your platform. Or not at all.
The resulting executable will reside in ,,build/src/lucheck-spp
.
A "make install" target is not provided, because the installation process requires some manual intervention as well as some decisions you'll have to make yourself. Basically, you'll have to perform the steps enumerated below. For RPM-based systems, a .spec file is provided (assuming a qmail installation under /var/qmail). The RPM-based installation requires some manual work as well.
/var/qmail
(the default location).
/var/qmail/plugins
.
make
, copy the resulting
executable to the plugin directory /var/qmail/plugins
.
LUCHECK_ALIASDIR
and optionally
LUCHECK_FFDB
, LUCHECK_DEBUG
or
LUCHECK_VERBOSE
to appropriate values.
LUCHECK_ALIASDIR=/var/qmail/alias LUCHECK_VERBOSE=yes export LUCHECK_ALIASDIR LUCHECK_VERBOSE tcpserver -R -v -x /etc/tcprules.smtpd.cdb -c 20 0 smtp qmail-smtpd 2>&1Don't forget to restart the service if required!
[rcpt]
section of the qmail-spp configuration file
/var/qmail/control/smtpplugins
.
Minimal example:
[auth] [helo] [mail] [rcpt] plugins/lucheck-spp