Valid RCPT TO patch for qmail

From X86wiki
(Redirected from Valid RCPT TO for qmail)
Jump to: navigation, search

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.

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

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

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."

References

Rejecting mail for non-existent users: