From: martin f. krafft Date: Sun, 23 Sep 2007 15:11:44 +0000 (+0200) Subject: delete X-Trained-As header after storing value in variable X-Git-Url: https://git.madduck.net/etc/mailfilter.git/commitdiff_plain/0cedb2f205d3552104ef3f7edc1d0640fedbd4ff?ds=sidebyside delete X-Trained-As header after storing value in variable --- diff --git a/procmail/cleanup b/procmail/cleanup index 646d2ab..0d71fd8 100644 --- a/procmail/cleanup +++ b/procmail/cleanup @@ -1,3 +1,7 @@ +:0 +* ^X-Trained-As: \/(h|sp)am +{ TRAINED_AS=$MATCH } + # remove all headers our mailfilter adds :0 fw |$FORMAIL -IX-EqDomain -IX-EqTo -IX-Justme -IContent-Length diff --git a/procmail/defines b/procmail/defines index 9b404de..e423f06 100644 --- a/procmail/defines +++ b/procmail/defines @@ -174,3 +174,7 @@ RETRAIN # JUSTME # if set, contains reason why justme message was passed JUSTME + +# TRAINED_AS +# if set, contains category with which this message has just been trained +TRAINED_AS diff --git a/procmail/spamfilter b/procmail/spamfilter index 95a0cbc..9e88642 100755 --- a/procmail/spamfilter +++ b/procmail/spamfilter @@ -29,21 +29,21 @@ PMDIR=${PMDIR:-$HOME/.etc/mailfilter/procmail} # |$FORMAIL -I"X-Spam: spamtrapped" #} -# check whether this message is being reinjected +# check whether this message is being resubmitted :0 *$ $MSG_DEJAVU { :0 - * ^X-Trained-As: \/(h|sp)am + * TRAINED_AS ?? . { - LOG="spamfilter: skipping already trained $MATCH$NL" + LOG="spamfilter: skipping already trained $TRAINED_AS$NL" :0 - * MATCH ?? spam + * TRAINED_AS ?? spam { IS_SPAM=already-trained } } :0 E - { LOG="spamfilter: skipping reinjected message$NL" } + { LOG="spamfilter: skipping resubmitted message$NL" } } # let earlier parts of the mailfilter cause bypassing the checks