Adding greylisting to QMT: Difference between revisions

From QmailToaster
Jump to navigation Jump to search
No edit summary
No edit summary
Line 8: Line 8:
  Add ,GREY=”" to /etc/tcprules.d/tcp.smtp
  Add ,GREY=”" to /etc/tcprules.d/tcp.smtp
  # vi /etc/tcprules/tcp.smtp<br>
  # vi /etc/tcprules/tcp.smtp<br>
:allow,BADMIMETYPE="",BADLOADERTYPE="M",CHKUSER_RCPTLIMIT="100",CHKUSER_WRONGRCPTLIMIT="20",QMAILQUEUE="/var/qmail/bin/simscan",NOP0FCHECK="1",GREY=""<br>
  :allow,BADMIMETYPE="",BADLOADERTYPE="M",CHKUSER_RCPTLIMIT="100",CHKUSER_WRONGRCPTLIMIT="20",QMAILQUEUE="/var/qmail/bin/simscan",NOP0FCHECK="1",GREY=""<br>
  Add GREYD paramater to /var/qmail/supervise/smtp/run<br>
  Add GREYD paramater to /var/qmail/supervise/smtp/run<br>
  vi /var/qmail/supervise/smtp/run
  vi /var/qmail/supervise/smtp/run
#!/bin/sh<br>
  #!/bin/sh<br>
QMAILDUID=`id -u vpopmail`
  QMAILDUID=`id -u vpopmail`
NOFILESGID=`id -g vpopmail`
  NOFILESGID=`id -g vpopmail`
MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
  MAXSMTPD=`cat /var/qmail/control/concurrencyincoming`
BLACKLIST=`cat /var/qmail/control/blacklists`
  BLACKLIST=`cat /var/qmail/control/blacklists`
SMTPD="/var/qmail/bin/qmail-smtpd"
  SMTPD="/var/qmail/bin/qmail-smtpd"
TCP_CDB="/etc/tcprules.d/tcp.smtp.cdb"
  TCP_CDB="/etc/tcprules.d/tcp.smtp.cdb"
RBLSMTPD="/usr/bin/rblsmtpd"
  RBLSMTPD="/usr/bin/rblsmtpd"
HOSTNAME=`hostname`
  HOSTNAME=`hostname`
VCHKPW="/home/vpopmail/bin/vchkpw"
  VCHKPW="/home/vpopmail/bin/vchkpw"
REQUIRE_AUTH=0
  REQUIRE_AUTH=0
GREYD="/var/qmail/bin/qmail-greyd"
  GREYD="/var/qmail/bin/qmail-greyd"


exec /usr/bin/softlimit -m 27000000 \
  exec /usr/bin/softlimit -m 27000000 \
/usr/bin/tcpserver -v -R -H -l $HOSTNAME -x $TCP_CDB -c "$MAXSMTPD" \
    /usr/bin/tcpserver -v -R -H -l $HOSTNAME -x $TCP_CDB -c "$MAXSMTPD" \
-u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
    -u "$QMAILDUID" -g "$NOFILESGID" 0 smtp \
$GREYD $RBLSMTPD $BLACKLIST $SMTPD $VCHKPW /bin/true 2>&1
    $GREYD $RBLSMTPD $BLACKLIST $SMTPD $VCHKPW /bin/true 2>&1


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

Revision as of 09:49, 30 March 2024

Note, this method is deprecated, in favor of using  spamdyke.
Download qmail-greyd and configure it
# 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
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