From: martin f. krafft Date: Sun, 23 Sep 2007 16:32:54 +0000 (+0200) Subject: add flagging of test messages X-Git-Url: https://git.madduck.net/etc/mailfilter.git/commitdiff_plain/016e0df0c545dddb3ef9097b1a52032e38ecd8ef add flagging of test messages --- diff --git a/config/skip-spamchecks b/config/skip-spamchecks index 773aeda..d96855a 100644 --- a/config/skip-spamchecks +++ b/config/skip-spamchecks @@ -1,6 +1,4 @@ -^X-Mailer: swaks v20[[:digit:].]+(-dev)? jetmore\.org/john/code/#swaks$ ^User-Agent: rss2email$ -^X-madduck-test: yes$ ^X-Original-To: [[:digit:]]+@tickle\.madduck\.net$ ^To:.*\ ^To:.*\ diff --git a/config/test-messages b/config/test-messages new file mode 100644 index 0000000..caaf049 --- /dev/null +++ b/config/test-messages @@ -0,0 +1,2 @@ +^X-Mailer: swaks v20[[:digit:].]+(-dev)? jetmore\.org/john/code/#swaks$ +^X-madduck-test: yes$ diff --git a/procmail/flag-test-messages b/procmail/flag-test-messages new file mode 100644 index 0000000..a247504 --- /dev/null +++ b/procmail/flag-test-messages @@ -0,0 +1,8 @@ +:0 BH +* ? $EGREP -qif $CONF/test-messages +{ + LOG="flag-test: flagging test message $MSGID$NL" + MSG_TEST=match + SPAM_UNKNOWN=test-message + SKIP_SPAMCHECKS=test-message +} diff --git a/procmail/procmailrc b/procmail/procmailrc index b72cc4e..6afe20c 100755 --- a/procmail/procmailrc +++ b/procmail/procmailrc @@ -19,6 +19,8 @@ INCLUDERC=$PMDIR/smsmail INCLUDERC=$PMDIR/logging INCLUDERC=$PMDIR/msgid-index +INCLUDERC=$PMDIR/flag-test-messages + INCLUDERC=$PMDIR/dejavu INCLUDERC=$PMDIR/cleanup INCLUDERC=$PMDIR/eqdomains diff --git a/procmail/spool b/procmail/spool index 61a7321..b7e5108 100644 --- a/procmail/spool +++ b/procmail/spool @@ -1,5 +1,6 @@ :0 c *$ ! $MSG_DEJAVU +* ! MSG_TEST ?? . { LOG="spool: saving message $MSGID to spool$NL" TRAP @@ -8,6 +9,11 @@ } :0 E +* MSG_TEST ?? . +{ LOG="spool: not saving test message to spool$NL" } + +:0 E +*$ $MSG_DEJAVU { LOG="spool: not saving resubmitted message to spool$NL" } # vim:ft=procmail diff --git a/procmail/to-gmail b/procmail/to-gmail index 21ab43e..e73c8f1 100644 --- a/procmail/to-gmail +++ b/procmail/to-gmail @@ -1,9 +1,9 @@ :0 * ORIG_DOMAIN ?? ^(mass|r2e)\.madduck\.net$ -* !^X-Mailer: swaks { :0 c *$ ! $MSG_DEJAVU + * ! MSG_TEST ?? . { LOG="gmail: archiving message $MSGID with gmail$NL" SENDMAILFLAGS="$SENDMAILFLAGS -f $ID" @@ -14,5 +14,10 @@ } :0 E + * MSG_TEST ?? . + { LOG="gmail: not archiving message test message with gmail$NL" } + + :0 E + *$ $MSG_DEJAVU { LOG="gmail: not archiving message resubmitted message with gmail$NL" } }