--- /dev/null
+^git@vger\.kernel\.org$
^Sender: owner-mutt-users@mutt\.org$
^Sender: owner-postfix-users@postfix\.org$
+$^ prevent CCs from git mailing list.
+^([Tt]o|[Cc]{2}):.*git@vger\.kernel.org
--- /dev/null
+:0 fw
+*$ !$MSG_DEJAVU
+|$FORMAIL -A"$DEJAVU_HEADER: $ID"
+
+:0 fw
+* SPAMTRAPPED ?? .
+|$FORMAIL -A"X-Spamtrapped: $SPAMTRAPPED"
+
+:0 fw
+* JUSTME ?? .
+|$FORMAIL -A"X-Justme: $JUSTME"
+
+:0 fw
+* EQ_DOMAIN ?? .
+|$FORMAIL -A"X-EqDomain: $ORIG_DOMAIN" -A"X-EqTo: $EQ_LOCAL@$EQ_DOMAIN"
+
+# vim:ft=procmail
:0
-*$ !$REPROC_MESSAGE
+*$ !$MSG_DEJAVU
{
}
RE_LASTNAME="kraff?t"
RE_EXTRACT_HEADER_VALUE="[ ]*\/[^ ].*"
+DEJAVU_HEADER=X-Deja-Vu
+
NULL=/dev/null
DISCARD=$BASE/.discard/
#DISCARD="'|$DELIVER -m BASE.discard'"
### run-time variables
-# REPROC_MESSAGE
+# MSG_DEJAVU
# a procmail-style flag, which is true if unset and false if set (to !).
-# unset by marknew if the message has already been seen by the filter (according
+# unset by dejavu if the message has already been seen by the filter (according
# to the X-Been-There header).
-REPROC_MESSAGE=!
+MSG_DEJAVU=!
# SKIP_SPAMCHECKS
# if set, cuases spamchecks to be skipped, value lists reason
# RETRAIN
# if set, causes spamfilters to be retrained, according to the variable's value
RETRAIN
+
+# JUSTME
+# if set, contains reason why justme message was passed
+JUSTME
--- /dev/null
+:0
+*$ ^$DEJAVU_HEADER: $ID
+{
+ LOG="dejavu: re-processing message $MSGID$NL"
+ MSG_DEJAVU
+}
LOCKFILE = $MID_CACHE_FILE$LOCKEXT
:0
*$ !SKIP_DUP ?? .
-*$ !$REPROC_MESSAGE
+*$ !$MSG_DEJAVU
* ^Message-ID:
* ? $FORMAIL -D 16384 $MID_CACHE_FILE
{
:0
* !ORIGINAL_TO ?? =.+@.+
{
- LOG="eqdomain: spamtrap message due to missing = in localpart ($ORIGINAL_TO)$NL"
- :0 fw
- |$FORMAIL -A"X-Spamtrapped: missing equal sign in eqdomain ($ORIGINAL_TO)"
- SPAMTRAPPED=eqdomain
+ SPAMTRAPPED="missing equal sign in eqdomain ($ORIGINAL_TO)"
+ LOG="eqdomain: $SPAMTRAPPED$NL"
}
:0 E
{
:0
* ORIG_LOCAL ?? ^\/[^=]+
- { EQ_LOCAL="$MATCH" }
+ {
+ EQ_LOCAL="$MATCH"
+ EQ_TO="$MATCH"
+ }
:0
* ORIG_LOCAL ?? .+=\/.+
- { EQ_DOMAIN="$MATCH" }
+ {
+ EQ_DOMAIN="$MATCH"
- LOG="eqdomain: message to $EQ_LOCAL@$EQ_DOMAIN via $ORIG_DOMAIN$NL"
+ :0
+ * EQ_LOCAL ?? .
+ { EQ_TO="$EQ_TO@$EQ_DOMAIN" }
+ }
- :0 fw
- |$FORMAIL -A"X-EqDomain: $ORIG_DOMAIN" -A"X-EqTo: $EQ_LOCAL@$EQ_DOMAIN"
+ LOG="eqdomain: message to $EQ_TO via $ORIG_DOMAIN$NL"
}
}
:0 H
*$ MSGID ?? ^<.+@$RE_MYDOMAIN>
{
- LOG="justme: passing; from machine in my domain$NL"
- :0 fw
- |$FORMAIL -I'X-Justme: from machine in my domain'
+ JUSTME="from machine in my domain"
+ LOG="justme: passing; $JUSTME$NL"
SKIP_SPAMCHECKS=from-mydomain
}
:0 EH
*$ ^(References|In-Reply-To):.*<.+@$RE_MYDOMAIN>
{
- LOG="justme: passing; in-reply-to/referenced$NL"
- :0 fw
- |$FORMAIL -I'X-Justme: in-reply-to/referenced'
+ JUSTME="in-reply-to/referenced"
+ LOG="justme: passing; $JUSTME$NL"
SKIP_SPAMCHECKS=in-reply-to/referenced
}
:0 E
* ? echo "$ORIGINAL_TO" | $EGREP -qif $CONF/justme-address-exceptions
- {
- LOG="justme: passing; explicitly excepted address$NL"
- :0 fw
- |$FORMAIL -I'X-Justme: in-reply-to/referenced'
+ {
+ JUSTME="explicitly excepted address"
+ LOG="justme: passing; $JUSTME$NL"
}
:0 EBH
*$ 1^0 B ?? $RE_FIRSTNAME$RE_SPACE_NEWLINE+$RE_LASTNAME
*$ 1^0 B ?? $RE_LASTNAME[,]?$RE_SPACE_NEWLINE*$RE_FIRSTNAME
{
- LOG="justme: passing; full name reference$NL"
- :0 fw
- |$FORMAIL -I'X-Justme: full name reference'
+ JUSTME="full name reference"
+ LOG="justme: passing; $JUSTME$NL"
}
:0 EBH
*$ B ?? $RE_LASTNAME
{
- LOG="justme: passing; last name reference$NL"
- :0 fw
- |$FORMAIL -I'X-Justme: last name reference'
+ JUSTME="last name reference"
+ LOG="justme: passing; $JUSTME$NL"
}
:0 EBH
* 1^0 B ?? madduck
* -1^0 B ?? mass\.madduck\.net
{
- LOG="justme: passing; nickname reference$NL"
- :0 fw
- |$FORMAIL -I'X-Justme: nickname reference'
+ JUSTME="nickname reference"
+ LOG="justme: passing; $JUSTME$NL"
}
:0 EBH
*$ ? $EGREP -qif $CONF/justme-keyword-exceptions
{
- LOG="justme: passing; keyword reference$NL"
- :0 fw
- |$FORMAIL -I'X-Justme: keyword reference'
+ JUSTME="keyword reference"
+ LOG="justme: passing; $JUSTME$NL"
}
:0 E
- {
+ {
LOG="justme: discarding$NL"
:0
$DISCARD
--- /dev/null
+:0
+* ? echo "$EQ_TO" | $EGREP -qif $CONF/cclists
+{
+ CORRESPONDENTS=`formail -cxTo: -xCc: -xFrom: | tr -s '\n' ,`
+ LOG="listquirks: adding M-F-T header for message on list $EQ_TO$NL"
+ :0 fw
+ |$FORMAIL -a "Mail-Followup-To: $CORRESPONDENTS"
+}
+
+# vim:ft=procmail
+++ /dev/null
-:0
-*$ ^X-Been-There: $ID
-{
- LOG="marknew: re-processing message $MSGID$NL"
- REPROC_MESSAGE
-}
-
-:0 Efw
-|$FORMAIL -A"X-Been-There: $ID"
INCLUDERC=$PMDIR/logging
-INCLUDERC=$PMDIR/marknew
+INCLUDERC=$PMDIR/dejavu
INCLUDERC=$PMDIR/eqdomains
INCLUDERC=$PMDIR/duplicates
INCLUDERC=$PMDIR/spammers
INCLUDERC=$PMDIR/spamfilter
+INCLUDERC=$PMDIR/addheaders
+
+INCLUDERC=$PMDIR/handlespam
+
#INCLUDERC=$PMDIR/autoreplies
INCLUDERC=$PMDIR/lurker
+INCLUDERC=$PMDIR/listquirks
+
INCLUDERC=$PMRULES/all
* ORIG_DOMAIN ?? ^mass\.madduck\.net$
{
DESTDIR=$BASE/.mass
-
- :0
- * ORIG_LOCAL ?? ^git=vger\.kernel\.org$
- {
- CORRESPONDENTS=`formail -cxTo: -xCc: -xFrom: | tr -s '\n' ,`
- :0 fw
- |$FORMAIL -a "Mail-Followup-To: $CORRESPONDENTS"
- }
+
:0
${DESTDIR}/
}
# Note: add E flag to next recipe when uncommenting
#:0
#* SPAMTRAPPED ?? .
-#{
+#{
# LOG="spamfilter: skipping checks for spamtrapped message$NL"
# :0 fw
# |$FORMAIL -I"X-Spam: spamtrapped"
# check whether this message is being reinjected
TRAINED_AS
:0
-*$ $REPROC_MESSAGE
+*$ $MSG_DEJAVU
* ^X-Trained-As: \/(h|sp)am
{
LOG="spamfilter: skipping already trained $MATCH$NL"
# let earlier parts of the mailfilter cause bypassing the checks
:0 E
* SKIP_SPAMCHECKS ?? .
-{
- LOG="spamfilter: skipping checks as requested: $SKIP_SPAMCHECKS$NL"
+{
+ LOG="spamfilter: skipping checks as requested: $SKIP_SPAMCHECKS$NL"
:0 fw
|$FORMAIL -I"X-Spam: unknown (skip requested)"
SPAM_UNKNOWN=skip-requested
:0 E
* CRM_SPAM ?? SPAM
* SA_SPAM ?? Yes
- {
+ {
IS_SPAM=sa+crm
:0 fw
|$FORMAIL -I"X-Spam: yes (crm114:$CRM_SCORE SA:$SA_SCORE)"
* SPAMTRAPPED ?? .
* ! SKIP_SPAMCHECKS ?? .
* ! IS_SPAM ?? .
-{
+{
LOG="spamfilter: found spamtrapped ham, retraining...$NL"
:0 fw
|$FORMAIL -I"X-Spam: spamtrapped ham"
RETRAIN=spam
}
-INCLUDERC=$PMDIR/handlespam
#VERBOSE=no
:0
* SPAMMER ?? @
{
- LOG="spammers: message from known spam sender$NL"
- :0 fw
- |$FORMAIL -A"X-Spamtrapped: from known spammer ($SPAMMER)"
- SPAMTRAPPED=known-spammer
+ SPAMTRAPPED='from known spammer ($SPAMMER)'
+ LOG="spammers: $SPAMTRAPPED$NL"
}
SPAMMER
:0
* ? echo "$ORIGINAL_TO" | $EGREP -qif $CONF/spamtraps
{
- LOG="spamtraps: message to known spamtrap$NL"
- :0 fw
- |$FORMAIL -A"X-Spamtrapped: message to known spamtrap ($ORIGINAL_TO)"
- SPAMTRAPPED=known-spamtrap
+ SPAMTRAPPED="message to known spamtrap ($ORIGINAL_TO)"
+ LOG="spamtraps: $SPAMTRAPPED$NL"
}
# vim:ft=procmail