Implement validrcptto feature
The goal is to verify the RCPT TO argument, and reject (at SMTP level) messages which were being sent to non-existent addresses.
Qmail sources needs to be patched as described in Step 2. If you've followed the entire guide, this is already done.
Unfortunately, the freecdb package provides not all the commands from original D.J. Bernstein tar file (cdbmake-12 and cdbmake-sv are missing). We have to compile to have the missing commands.
gzip -dc < cdb-0.75.tar.gz | tar -xf -
echo 'gcc -O2 -include /usr/include/errno.h' > conf-cc
make setup check
Then install mkvalidrcptto script and test all used libraries are loaded correctly:
chmod 755 /usr/local/bin/mkvalidrcptto
perl -cwT /usr/local/bin/mkvalidrcptto
You should see something like that:
mkvalidrcptto syntax OK
We can now create a first CDB file containing all the created accounts
mkvalidrcptto > validrcptto.txt
cdbmake-12 validrcptto.cdb validrcptto.tmp < validrcptto.txt
We finally will start using it.
To achieve this, edit the file /var/qmail/supervise/qmail-smtpd/run and uncomment following options :
Automate the update of valid adress list
chmod +x /etc/cron.hourly/update-validrcptto
If you need each change to be reflected immediately, do not put script in cron but compile vpopmail with the --onchange feature.
In such case, read the file /downloads/vpopmail-5.4.33/doc/README.onchange for more information
Restart the service