From 0cedb2f205d3552104ef3f7edc1d0640fedbd4ff Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Sun, 23 Sep 2007 17:11:44 +0200 Subject: [PATCH] delete X-Trained-As header after storing value in variable --- procmail/cleanup | 4 ++++ procmail/defines | 4 ++++ procmail/spamfilter | 10 +++++----- 3 files changed, 13 insertions(+), 5 deletions(-) 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 -- 2.39.2