import EXT import HOST VHOME=`/home/vpopmail/bin/vuserinfo -d $EXT@$HOST` DOMDIR=`/home/vpopmail/bin/vdominfo -d $HOST` NOEXT=`echo $EXT | awk -F- '{ print $1}'` JUNK="$VHOME/Maildir/.Junk/" #DELETESCORE=10 DUMMY=`test -d $VHOME/Maildir` if ( $RETURNCODE == 1 ) { #echo "equal??" DUMMY=`test $EXT = $NOEXT` if ( $RETURNCODE == 1 ) { #echo "not equal" VHOME=`/home/vpopmail/bin/vuserinfo -d $NOEXT@$HOST` } } DUMMY=`test -d $VHOME/Maildir` if ( $RETURNCODE == 1 ) { DUMMY=`grep bounce-no-mailbox $DOMDIR/.qmail-default` if ( $RETURNCODE == 0 ) { echo "Sorry, no mailbox here by that name. (#5.1.1) - maildrop" EXITCODE=100 exit } DUMMY=`grep ' delete$' $DOMDIR/.qmail-default` if ( $RETURNCODE == 0 ) { echo "Deleted mail for non-existent user $EXT@$HOST - maildrop" EXITCODE=0 exit } # else, it's either a Maildir or forward ARG4=`awk '{ print $4 }' $DOMDIR/.qmail-default` # check forward first DUMMY=`echo $ARG4 | /usr/bin/grep '@'` if ( $RETURNCODE == 0 ) { to '| /var/qmail/bin/qmail-inject' } # then check Maildir DUMMY=`echo $ARG4 | /usr/bin/grep '^/'` if ( $RETURNCODE == 0 ) { VHOME="$ARG4" JUNK="$ARG4/Maildir/.Junk/" } } if (/^X-Spam-Flag:\s*YES/) { exception { /^X-Spam-Status:\s*Yes, score=(-*[0-9]+\.[0-9]+)/ SCORE=$MATCH1 #if ($SCORE >= $DELETESCORE ) #{ #if ( /^From:\s*(.*)/ ) #{ #ADDR=getaddr($MATCH1) #} #echo "maildrop: auto-deleted spam from $FROM::$ADDR to $EXT@$HOST with score of $SCORE" #to /dev/null #} } DUMMY=`test -d $JUNK` if ( $RETURNCODE == 1 ) { `/var/qmail/bin/maildirmake $JUNK` echo "created $JUNK" } echo "maildrop: filtered junk-mail delivery with score of $SCORE to $JUNK" to $JUNK } echo "maildrop: non-filtered mail delivery" DUMMY=`test -f $VHOME/.mailfilter` if ( $RETURNCODE == 0 ) { include $VHOME/.mailfilter } to $VHOME/Maildir/