Posted in
The validrcptto patch consults a CDB file, /var/qmail/control/validrcptto.cdb which should contain every valid email address and alias on your server. Rather than generate this list manually or try to create our own script to do it, we'll utilize John Simpson's mkvalidrcptto script.
We've already installed djb's CDB program, so we can proceed with installing the CDB_File Perl module. If you've never used the CPAN shell before on this server, you'll need to configure it the default options it provides should be adequate.
perl -MCPAN -e shell
install CDB_File
exitIn case the Perl module didn't install with the correct permissions, we'll use John Simpson's pfix script to fix them.
cd /usr/local/bin
wget http://www.jms1.net/code/pfix
chmod 755 pfix
pfixInstalling the
mkvalidrcptto script is simple matter of downloading it:cd /usr/local/bin
wget http://qmail.jms1.net/scripts/mkvalidrcptto
wget http://qmail.jms1.net/scripts/mkauth
chmod 755 mkvalidrcptto mkauthTo create the initial CDB files, run mkvalidrcptto and mkauth commands with the -c option:
cd /var/qmail/control
mkvalidrcptto -c /var/qmail/control/validrcptto.cdb
mkauth -c /var/qmail/control/auth.cdbSMTP run script
The run script for your SMTP service might need to be modified to enable validrcptto checks. Uncomment:
VALIDRCPTTO_CDB="$VQ/control/validrcptto.cdb"
VALIDRCPTTO_LIMIT=5
VALIDRCPTTO_LOG=2Excluding addresses from validrcptto
In order to exclude some email addresses from the validrcptto file and not accept delivery to them, they can be added to /usr/local/bin/mkvalidrcptto by editing this section:
# any entries listed in this array will NOT be included in the output
my @exclude = qw
(
sample1@domain.xyz
sample2@domain.xyz
) ;- Login to post comments