Valid RCPT TO patch for qmail
Download netqmail-1.06 and patch with John M. Simpson's validrcptto patch.
Install D.J.Bernstein's cdb (constant data base) system.
cdb is a constant database, meaning that it cannot be updated at a runtime, but of course, it can be rebuilt or recompiled as many times as needed and run again.
Create and Activate CDB database with valid recipient addresses
Create a text file which lists all the valid addresses you wish to receive mail to. Since DJB's cdb system is a <key><value> pair system, add any arbitrary "value" to each email in your list.
Here is an example:
email@example.com 1 firstname.lastname@example.org 2 email@example.com 3 firstname.lastname@example.org 4
If you wish to receive mail for all and any name at a particular domain, list it without a user: Here, all names will validate for "domain-z.com"
To build the cdb database from your text file:
cdbmake-12 my.emails.cdb my.emails.tmp < my.emails.txt
then copy it:
cp my.emails.cdb /var/qmail/control/validrcptto.cdb
Environment Variables for Proper Functioning of validrcptto patch
/usr/bin/qmailctl must be augmented to have the following environment variables:
# jms1.net validrccpto.2 patch applied to netqmail-1.06 VALIDRCPTTO_CDB=/var/qmail/control/validrcptto.cdb export VALIDRCPTTO_CDB VALIDRCPTTO_LIMIT=5 export VALIDRCPTTO_LIMIT VALIDRCPTTO_LOG=1 export VALIDRCPTO_LOG
After changing these validrcpto variables, execute qmailctl restart to register the changes with the running instance of qmail .
Turning Valid Recipient Checking ON / OFF
Reporter: "What would you do if you found a million dollars?" Yogi Berra: "If the guy was poor, I would give it back."
Rejecting mail for non-existent users:
- http://www.soffian.org/downloads/qmail/qmail-smtpd-doc.html Recipient Check with fine granularity.