Valid RCPT TO patch for qmail
Contents |
[edit] Installation
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.
[edit] 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:
john@domain1.com 1 steve@domain1.com 2 ann@domain2.com 3 info@domain-x.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"
@domain-z.com 5
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
[edit] 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 .
[edit] Turning Valid Recipient Checking ON / OFF
environment variables:
- RELAYCLIENT
- VALIDRCPTTO_LIMIT
Reporter: "What would you do if you found a million dollars?" Yogi Berra: "If the guy was poor, I would give it back."
[edit] References
- http://qmail.jms1.net/patches/validrcptto.cdb.shtml
- http://en.wikipedia.org/wiki/Cdb_%28software%29
- http://http.netdevice.com:9080/qmail/rcptck/
- http://www.webhostingtalk.com/archive/index.php/t-350538.html
Rejecting mail for non-existent users:
- http://www.soffian.org/downloads/qmail/qmail-smtpd-doc.html Recipient Check with fine granularity.
- http://forum.parallels.com/showthread.php?t=62036