Implement greylisting feature
Greylisting (or graylisting) is a method of defending e-mail users against spam.
With this feature, qmail will "temporarily reject" any email from a sender it does not recognize. If the mail is legitimate the originating server will, after a delay, try again and, if sufficient time has elapsed, the email will be accepted. If the mail is from a spam sender, sending to many thousands of email addresses, it will probably not be retried.
We 'll make use of Perl scripts jgreylist and jgreylist-clean written by John Simpson
Edit /var/qmail/supervise/qmail-smtpd/run and change the following
GREYLIST="/var/qmail/bin/jgreylist"
JGREYLIST_DIR="$VQ/jgreylist"
JGREYLIST_DIR="$VQ/jgreylist"
cp /downloads/scripts/jgreylist /var/qmail/bin
cp /downloads/scripts/jgreylist-clean /usr/local/sbin
chown root:vchkpw /var/qmail/bin/jgreylist
chmod 0750 /var/qmail/bin/jgreylist
chown root:root /usr/local/sbin/jgreylist-clean
chmod 0755 /usr/local/sbin/jgreylist-clean
mkdir -m 0700 /var/qmail/jgreylist
chown vpopmail:vchkpw /var/qmail/jgreylist
echo '/usr/local/sbin/jgreylist-clean 2>&1 > /dev/null' > /etc/cron.daily/jgreylist-clean
qmailctl restart
cp /downloads/scripts/jgreylist-clean /usr/local/sbin
chown root:vchkpw /var/qmail/bin/jgreylist
chmod 0750 /var/qmail/bin/jgreylist
chown root:root /usr/local/sbin/jgreylist-clean
chmod 0755 /usr/local/sbin/jgreylist-clean
mkdir -m 0700 /var/qmail/jgreylist
chown vpopmail:vchkpw /var/qmail/jgreylist
echo '/usr/local/sbin/jgreylist-clean 2>&1 > /dev/null' > /etc/cron.daily/jgreylist-clean
qmailctl restart
OPTIONAL : If you need more performance you can use a compiled version of jgreylist
cd /downloads/scripts/
mv /downloads/scripts/jgreylist /downloads/scripts/jgreylist.pl
make jgreylist
cp /downloads/scripts/jgreylist /var/qmail/bin
chown root:vchkpw /var/qmail/bin/jgreylist
chmod 0750 /var/qmail/bin/jgreylist
mv /downloads/scripts/jgreylist /downloads/scripts/jgreylist.pl
make jgreylist
cp /downloads/scripts/jgreylist /var/qmail/bin
chown root:vchkpw /var/qmail/bin/jgreylist
chmod 0750 /var/qmail/bin/jgreylist
Users comments