Qmail and maildrop to filter spam out of RT

Hello ,

recently we have spam coming to RT, it is correctly tagged by our Spamassasin on gateway
however, I wanted keep this messages out of queue.
We are using qmail / vpopmail /spamassassin, for tagging we are using
tag SPAM, maildrop will do rest.

after some coffee :wink: here are results, I hope it help to someone with
similar problems:

cat /home/vpopmail/domains/domain.com/.qmail-helpdesk
|maildrop

cat /etc/maildroprc
#!/bin/bash

checking incoming mail for tag from Spamassassin in Subject line

if email is tagged , it will deliver message to admin mailbox directly

(can be changed to email address)

if is email OK, maildrop will pass msg to RT queue

(c) Miki :wink:

logfile “/var/log/qmail/maildrop.log”
import EXT
import HOST
VHOME=/home/vpopmail/domains/domain.com/useradmin
VPOP=“| /opt/rt3/bin/rt-mailgate --queue Helpdesk --action correspond
–url http://rt.domain.com/

if ( /^Subject: \*\*\*\*SPAM\*\*\*\*/ )
         {
         to $VHOME/Maildir
         EXITCODE=100
         exit
         }
else
         {
             to $VPOP
             exit
         }