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 -
cd /downloads/cdb-0.75
echo 'gcc -O2 -include /usr/include/errno.h' > conf-cc
make
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 :
VALIDRCPTTO_LIMIT=10
VALIDRCPTTO_LOG=2
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
External reference
http://qmail.jms1.net/patches/validrcptto.cdb.shtmlhttp://www.x86linux.org/wiki/index.php/Valid_RCPT_TO_for_qmail
Users comments
Good evening, i have a problems with cbdmake-12 where i can find ?
Hi Thibs,
For amd64 you can also just follow totorial as pointed by you but change i386 with amd64 for dpkg install:
I've recently explained this in one of my comments.
Best,
Georgi
The problem with using vpopmail's onchange function is that it doesn't remove users from the database. Because of this, you should probably use both the onchenge (to immediately add users) and the cron script (to eventually remove users.
From the onchange docs:
"Commands that add or update call the script after making their changes. Commands that delete something call the script before doing the delete."
mkvalidrcptto > validrcptto.txt
Cannot continue.
solved with cat /var/qmail/control/me > /var/qmail/control/locals
Hi @Claudio
You can use cdb-0.75.tar.gz that you download to /download directory.
now cbdmake-12 is installed.