QMAIL-RCPTCHECK(8)

NAME
qmail-rcptcheck - run a sequence of sender/recipient checks

SYNOPSIS
qmail-rcptcheck

DESCRIPTION
qmail-rcptcheck runs an administrator-defined sequence of programs to check SMTP envelope senders and recipients. Checks must adhere to the RCPTCHECK interface. If any check rejects, the message is rejected.

qmail-rcptcheck is most commonly invoked from qmail-smtpd patched with either qmail-spp or RCPTCHECK.

ENVIRONMENT VARIABLES
To run under qmail-spp: none needed.

To run under RCPTCHECK: set RCPTCHECK to /var/qmail/bin/qmail-rcptcheck in your tcpserver's tcprules (and rebuild the CDB).

To perform checks, inspect these variables:

SENDER
    Contains the envelope sender.

RECIPIENT
    Contains the envelope recipient.

CONTROL FILES
To run under qmail-spp: add /var/qmail/bin/qmail-rcptcheck in the [rcpt] section of smtpplugins.

To run under RCPTCHECK: none needed.

In either case, to control qmail-rcptcheck:

rcptchecks
    Sequence of checks.

RCPTCHECK-compatible programs must be listed one per line, with no arguments. Changing the sequence takes effect immediately, no restart required. If the control file is empty, contains only comments, or doesn't exist, messages are not rejected.

To test your configuration, as root, in /var/qmail:

# env SENDER=a RECIPIENT=b setuidgid qmaild qmail-rcptcheck; echo $?

EXIT CODES
As defined by the RCPTCHECK interface, 120 is reserved. Recipient-checking programs should exit 111 when unable to verify, 100 to reject, or any other non-reserved code to accept.

COMPATIBILITY
RCPTCHECK-compatible programs can run unmodified under qmail-spp simply by running them from qmail-rcptcheck.

ERRORS
Some typical SMTP errors and their likely causes:

421 unable to execute recipient check (#4.3.0)
    The control file lists a program that doesn't exist or otherwise can't be executed.

EXAMPLES
See https://schmonz.com/qmail/rejectutils.

AUTHOR
Amitai Schleier <schmonz-web-rejectutils@schmonz.com>

HISTORY
Based on this code from Jay Soffian:

http://www.soffian.org/downloads/qmail/qmail-smtpd-doc.html

SEE ALSO
qmail-rcptcheck-badrcptto(8), qmail-rcptcheck-qregex(8), qmail-rcptcheck-realrcptto(8), qmail-smtpd(8).

http://qmail-spp.sourceforge.net/doc/