• Pricing
  • Features
    • InterWorx
    • Clustering
    • Developers
    • Roadmap
  • Support
    • Overview
    • Latest News and Blog
    • Documentation
    • InterWorx Forums
    • Version History
    • Help Desk
    • FAQ’s
    • Feedback and Feature Requests
  • Company
    • End User License Agreement
    • Privacy Policy
    • Bug Bounty
    • InterWorx Partners
    • Our Brand
    • Website Accessibility Statement
    • Contact Us
  • My Account
How to Enable Tarpitting to Reduce Spam
August 23, 2017
How to Set Individual/Per-Domain php.ini Configurations for PHP-FPM
June 10, 2019

How to Enable Greylisting to Prevent Spam

Published by InterWorx on February 9, 2018

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: https://www.greylisting.org/

Enabling this along with tarpitting can even more effective in reducing spam. For documentation on how to enable tarpitting, click here: http://www.interworx.com/support/faq/enable-tarpitting-reduce-spam/

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:

127.:allow,RELAYCLIENT="",JGREYLIST=""
::1:allow,RELAYCLIENT="",JGREYLIST=""
:allow,LANG="en_US",QMAILQUEUE="/var/qmail/bin/simscan",CHKUSER_MBXQUOTA="99",JGREYLIST_DIR="/var/qmail/jgreylist",JGREYLIST=""

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:

127.:allow,RELAYCLIENT="",JGREYLIST=""
::1:allow,RELAYCLIENT="",JGREYLIST=""
:allow,LANG="en_US",QMAILQUEUE="/var/qmail/bin/simscan",CHKUSER_MBXQUOTA="99",JGREYLIST_DIR="/var/qmail/jgreylist"

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:

#!/bin/sh
QMAILDUID=`id -u vpopmail`
NOFILESGID=`id -g vpopmail`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
BLACKLIST=`cat /var/qmail/control/blacklists`
SMTPD="/var/qmail/bin/qmail-smtpd"
TCP_CDB="/etc/tcprules.d/tcp.smtp.cdb"
RBLSMTPD="/usr/bin/rblsmtpd"
HOSTNAME=`hostname`
VCHKPW="/home/vpopmail/bin/vchkpw"
GREYLIST="/var/qmail/bin/jgreylist"
ARCH=`uname -i`

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

[[email protected] tcprules.d]# ls -ld /var/qmail/jgreylist
drwx------. 2 root root 6 Apr 11 2016 /var/qmail/jgreylist
[[email protected] tcprules.d]# chown vpopmail:vchkpw /var/qmail/jgreylist
7. Restart smtp using the following command:
service smtp restart
Share
3

Related posts

July 3, 2020

How to Install and Use the CloudLinux Plugin for InterWorx


Read more
April 10, 2020

How to Install and Use the Acronis Plugin for InterWorx


Read more
December 11, 2019

Non-prefixed MySQL Database Names and MySQL User Names, DB mapping


Read more
  • Liquid Web Family of Brands
  • Liquid Web
  • Visit Nexcess
  • Visit iThemes
  • Visit Interworx
© 2019 InterWorx, LLC. All Rights Reserved.
      We use cookies to understand how you interact with our site, to personalize and streamline your experience, and to tailor advertising. By continuing to use our site, you accept our use of cookies and accept our Privacy Policy.