How to Enable Greylisting to Prevent Spam

Share this post...Tweet about this on TwitterShare on Google+0Share on Facebook0
Greylisting means that the server will initially reject mail from unknown senders and then accepts the message up on the second attempt. This involves a greet delay, so messages will have to wait a few seconds before being accepted. Legitimate mail will wait, but spam will generally not. Further information:
Enabling this along with tarpitting can even more effective in reducing spam. For documentation on how to enable tarpitting, click here:

Set Up:

To enable greylisting, follow these steps:

1. At the command line, use the text editor to view /etc/tcprules.d/tcp.smtp. It will look similar to the following:


2. On the line that begins with :allow, if  JGREYLIST="" exists, delete JGREYLIST=".

3. On the line that begins with :allow, if  JGREYLIST_DIR="/var/qmail/jgreylist" does not already exist, add the following: JGREYLIST_DIR="/var/qmail/jgreylist". Example:


4. Using the text editor, open service/smtp/run.

5. Make sure that the GREYLIST variable is listed and is also not commented out. It should point to /var/qmail/bin/jgreylist Example:

QMAILDUID=`id -u vpopmail`
NOFILESGID=`id -g vpopmail`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
BLACKLIST=`cat /var/qmail/control/blacklists`
ARCH=`uname -i`

6. Set permissions on /var/qmail/jgreylist so that it is owned by vpopmail:

[root@localhost tcprules.d]# ls -ld /var/qmail/jgreylist
drwx------. 2 root root 6 Apr 11 2016 /var/qmail/jgreylist
[root@localhost tcprules.d]# chown vpopmail:vchkpw /var/qmail/jgreylist

6. Restart smtp using the following:

service smtp restart

Feb 9, 2018, 2:48 pmBy: InterWorx
How to Enable Greylisting to Prevent Spam
9 votes, 2.78 avg. rating (54% score)
(0) Comments

Leave a Reply
Surround code blocks with <pre>code</pre>

Your email address will not be published.


Broken Link