Adding greylisting to QMT: Difference between revisions

From QmailToaster
Jump to navigation Jump to search
(Created page with "'''Note, this method is deprecated, in favor of using spamdyke. Based on: http://www.kabewm.com/?p=19 and http://thomas.mangin.me.uk/software/qmail-greylist.html Download qmail-greyd and configure it <pre> cd /var/qmail/bin wget http://thomas.mangin.me.uk/data/source/qmail-greyd chmod +x qmail-greyd mkdir /var/qmail/grey chown vpopmail.vchkpw /var/qmail/grey </pre> Add ,GREY=”" to the :allow statement at the bottom of /etc/tcprules.d/tcp.smtp <pre>...")
 
No edit summary
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''Note, this method is deprecated, in favor of using [[Spamdyke | spamdyke]].
[[User_Tips_%26_Tricks#Anti_Spam|Back]]<br>
 
Download and configure qmail-greyd*
Based on: http://www.kabewm.com/?p=19 and http://thomas.mangin.me.uk/software/qmail-greylist.html
# cd /var/qmail/bin
 
# wget http://thomas.mangin.me.uk/data/source/qmail-greyd ([[qmail-greyd|qmail-greyd]])
Download qmail-greyd and configure it
# chmod +x qmail-greyd
 
# mkdir /var/qmail/grey
<pre>
# chown vpopmail.vchkpw /var/qmail/grey<br>
cd /var/qmail/bin
Add ,GREY=”" to /etc/tcprules.d/tcp.smtp
wget http://thomas.mangin.me.uk/data/source/qmail-greyd
# vi /etc/tcprules/tcp.smtp<span style="color:red">
chmod +x qmail-greyd
  :allow,BADMIMETYPE="",BADLOADERTYPE="M",CHKUSER_RCPTLIMIT="100",CHKUSER_WRONGRCPTLIMIT="20",QMAILQUEUE="/var/qmail/bin/simscan",NOP0FCHECK="1",GREY=""</span>
mkdir /var/qmail/grey
Add GREYD paramater to /var/qmail/supervise/smtp/run
chown vpopmail.vchkpw /var/qmail/grey
# vi /var/qmail/supervise/smtp/run<span style="color:red">
</pre>
  #!/bin/sh<br>
 
  QMAILDUID=`id -u vpopmail`
Add ,GREY=”" to the :allow statement at the bottom of /etc/tcprules.d/tcp.smtp
  NOFILESGID=`id -g vpopmail`
 
  MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
<pre>
  BLACKLIST=`cat /var/qmail/control/blacklists`
vi /etc/tcprules/tcp.smtp
  SMTPD="/var/qmail/bin/qmail-smtpd"
</pre>
  TCP_CDB="/etc/tcprules.d/tcp.smtp.cdb"
<pre>
  RBLSMTPD="/usr/bin/rblsmtpd"
:allow,BADMIMETYPE="",BADLOADERTYPE="M",CHKUSER_RCPTLIMIT="100",CHKUSER_WRONGRCPTLIMIT="20",DKVERIFY="DEfhIJK",QMAILQUEUE="/var/qmail/bin/simscan",DKQUEUE="/var/qmail/bin/qmailqueue.orig",DKSIGN="/var/qmail/contol/domainkeys/%/private",NOP0FCHECK="1",GREY=""
  HOSTNAME=`hostname`
</pre>
  VCHKPW="/home/vpopmail/bin/vchkpw"
 
  REQUIRE_AUTH=0
Add GREYD paramater to /var/qmail/supervise/smtp/run
  GREYD="/var/qmail/bin/qmail-greyd"<br>
 
  exec /usr/bin/softlimit -m 27000000 \
<pre>vi /var/qmail/supervise/smtp/run</pre>
    /usr/bin/tcpserver -v -R -H -l $HOSTNAME -x $TCP_CDB -c "$MAXSMTPD" \
<pre>
    -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
#!/bin/sh<br>
    $GREYD $RBLSMTPD $BLACKLIST $SMTPD $VCHKPW /bin/true 2>&1</span><br>
QMAILDUID=`id -u vpopmail`
Rebuild  tcprules and restart qmail
NOFILESGID=`id -g vpopmail`
# qmailctl cdb
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
# qmailctl stop && sleep 2 && qmailctl start<br>
BLACKLIST=`cat /var/qmail/control/blacklists`
<b>*</b>''Note, this method is deprecated, in favor of using [[Spamdyke | spamdyke]]''
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"
REQUIRE_AUTH=0
GREYD="/var/qmail/bin/qmail-greyd"
 
exec /usr/bin/softlimit -m 27000000 \
/usr/bin/tcpserver -v -R -H -l $HOSTNAME -x $TCP_CDB -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
$GREYD $RBLSMTPD $BLACKLIST $SMTPD $VCHKPW /bin/true 2>&1
</pre>
 
Re-built tcprules and re-start qmail
<pre>
service qmail cdb
service qmail restart
</pre>

Latest revision as of 11:07, 30 March 2024

Back

Download and configure qmail-greyd*
# cd /var/qmail/bin
# wget http://thomas.mangin.me.uk/data/source/qmail-greyd (qmail-greyd)
# chmod +x qmail-greyd
# mkdir /var/qmail/grey
# chown vpopmail.vchkpw /var/qmail/grey
Add ,GREY=”" to /etc/tcprules.d/tcp.smtp # vi /etc/tcprules/tcp.smtp :allow,BADMIMETYPE="",BADLOADERTYPE="M",CHKUSER_RCPTLIMIT="100",CHKUSER_WRONGRCPTLIMIT="20",QMAILQUEUE="/var/qmail/bin/simscan",NOP0FCHECK="1",GREY="" Add GREYD paramater to /var/qmail/supervise/smtp/run # vi /var/qmail/supervise/smtp/run #!/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" REQUIRE_AUTH=0 GREYD="/var/qmail/bin/qmail-greyd"
exec /usr/bin/softlimit -m 27000000 \ /usr/bin/tcpserver -v -R -H -l $HOSTNAME -x $TCP_CDB -c "$MAXSMTPD" \ -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \ $GREYD $RBLSMTPD $BLACKLIST $SMTPD $VCHKPW /bin/true 2>&1

Rebuild tcprules and restart qmail # qmailctl cdb # qmailctl stop && sleep 2 && qmailctl start

*Note, this method is deprecated, in favor of using spamdyke