]> git.madduck.net Git - etc/mailfilter.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

make all deliveries happen late
authormartin f. krafft <madduck@madduck.net>
Sun, 23 Sep 2007 16:59:49 +0000 (18:59 +0200)
committermartin f. krafft <madduck@madduck.net>
Sun, 23 Sep 2007 16:59:49 +0000 (18:59 +0200)
15 files changed:
procmail/deliver
procmail/handlespam
procmail/listquirks
procmail/logging
procmail/procmailrc
procmail/rules/admin
procmail/rules/all
procmail/rules/debian
procmail/rules/feeds
procmail/rules/mass
procmail/rules/sudetia
procmail/rules/ul
procmail/spamfilter
procmail/tickle
procmail/to-gmail

index c3188ff55d82eebcb050f25a80ce1edd7fcf813f..5a4f355d3a82b8397b851ec5f7c97cbf8fcc60fc 100644 (file)
@@ -1,30 +1,26 @@
 :0
-* DEST ?? .
-{
-  :0
-  * DEST ?? .+[^/]$
-  { DEST="$DEST/" }
+* ! DEST ?? .
+{ DEST="$DEFAULT" }
 
-  :0
-  *$ DEST ?? ^$BASE/\/.+
-  { DEST="$MATCH" }
-
-  :0
-  *$ DEST ?? ^\.
-  { }
+:0
+* DEST ?? .+[^/]$
+{ DEST="$DEST/" }
 
-  :0 E
-  { DEST=".$DEST" }
+:0
+*$ DEST ?? ^$BASE/\/.+
+{ DEST="$MATCH" }
 
-  LOG="deliver:     delivering message $MSGID to $DEST$NL"
-  DEST="$BASE/$DEST"
-  :0
-  $DEST
-}
+:0
+*$ DEST ?? ^\.
+{ }
 
 :0 E
-{
-  LOG="deliver:     delivering message $MSGID to default destination$NL"
-  :0
-  $DEFAULT
-}
+{ DEST=".$DEST" }
+
+TRAP="DEST=\"\${LASTFOLDER#$BASE/}\";
+      echo \"delivered:   \$DEST\" >> '$THISLOGFILE';
+      $TRAP"
+
+LOG="deliver:     delivering message $MSGID to $DEST$NL"
+:0
+$BASE/$DEST
index cab35eb6f47f9879ca35f0b57b9f95015406c1b8..233234ab3d2c32d19d9c420f3c9096001061d23f 100644 (file)
@@ -34,7 +34,7 @@
 {
   LOG="spamfilter:  filing as unsure$NL"
   :0
-  $BASE/.retrain.unsure/
+  { DEST=retrain.unsure }
 }
 
 :0 E
@@ -42,7 +42,7 @@
 {
   LOG="spamfilter:  filing as disagreed$NL"
   :0
-  $BASE/.retrain.disagree/
+  { DEST=retrain.disagree }
 }
 
 :0 E
@@ -70,7 +70,7 @@
 {
   LOG="spamfilter:  filing as spam$NL"
   :0
-  $BASE/.spam/
+  { DEST=spam }
 }
 
 :0
index ea729a82050e31fed47b6d592a17b18eddbd82d1..6ceeb007abd403527050a7a44ac239142ccad03b 100644 (file)
@@ -5,6 +5,7 @@
 #   send-hook '~C git@vger\.kernel\.org' 'unset followup_to'
 #
 :0
+* ! DEST ?? .
 * ? echo "$EQ_TO" | $EGREP -qif $CONF/cclists
 * ! ^Mail-Followup-To:
 {
index d812032ae1dc54141b2fff5eda503b3d834383a3..38b901a9edf013fd4beb674d82ce92644ce8c2cd 100644 (file)
@@ -20,9 +20,7 @@ from:        $FROM
 original-to: $ORIGINAL_TO
 subject:     $SUBJECT$NL"
 
-TRAP="DEST=\"\${LASTFOLDER#$BASE/}\";
-      echo \"delivered:   \$DEST\" >> '$THISLOGFILE';
-      echo >> '$THISLOGFILE';
+TRAP="echo >> '$THISLOGFILE';
       egrep -v '^XX(procmail:)?[[:space:]\"]' '$THISLOGFILE' >> $MASTERLOGFILE"
 
 #VERBOSE=yes
index 6afe20cd7a5b1a50c368d36c50ffcb235beb97a9..93b6235c5e84f96f3ae8745e62f30beb0bd3cfef 100755 (executable)
@@ -31,12 +31,8 @@ INCLUDERC=$PMDIR/to-gmail
 
 INCLUDERC=$PMDIR/justme
 
-INCLUDERC=$PMDIR/spamtraps
-INCLUDERC=$PMDIR/spammers
 INCLUDERC=$PMDIR/spamfilter
 
-INCLUDERC=$PMDIR/addheaders
-
 INCLUDERC=$PMDIR/handlespam
 
 #INCLUDERC=$PMDIR/autoreplies
@@ -49,4 +45,5 @@ INCLUDERC=$PMDIR/listquirks
 
 INCLUDERC=$PMRULES/all
 
+INCLUDERC=$PMDIR/addheaders
 INCLUDERC=$PMDIR/deliver
index 0fcf767f9d54528cec314281ab8be443397dcedf..2873572da416e208020b811ed7f2f45e3690297b 100644 (file)
@@ -13,7 +13,7 @@
   }
 
   :0
-  $BASE/.admin/
+  { DEST=admin }
 
 #  DESTDIR="$BASE/.admin.`echo $EQ_DOMAIN | tr . _"
 #
index 456e55b47539faff6ed9566534974e8894998527..a8b24dae71960155cfc4c7577a02645255e9d079 100644 (file)
@@ -1,8 +1,12 @@
-INCLUDERC=$PMRULES/feeds
-INCLUDERC=$PMRULES/admin
-INCLUDERC=$PMRULES/ul
-INCLUDERC=$PMRULES/debian
-INCLUDERC=$PMRULES/sudetia
-INCLUDERC=$PMRULES/mass
+:0
+* ! DEST ?? .
+{
+  INCLUDERC=$PMRULES/feeds
+  INCLUDERC=$PMRULES/admin
+  INCLUDERC=$PMRULES/ul
+  INCLUDERC=$PMRULES/debian
+  INCLUDERC=$PMRULES/sudetia
+  INCLUDERC=$PMRULES/mass
+}
 
 # vim:ft=procmail
index f5442e92dc6f75c5c903c52fb849b465ee651912..4c6330d7abd939ecb5c643afc869d21a77b72c10 100644 (file)
@@ -1,22 +1,22 @@
 :0
 * ^X-Debian-PR-Source: \/.+
 * ? grep -q "^${MATCH}$" $CONF/debian-packages
-$BASE/.debian.$MATCH/
+{ DEST=debian.$MATCH }
 
 :0
 * ORIGINAL_TO ?? ^logcheck-(devel|commits)=lists\.alioth\.debian\.org@mass\.madduck\.net$
-$BASE/.debian.logcheck/
+{ DEST=debian.logcheck }
 
 :0
 * ORIGINAL_TO ?? ^pkg-mdadm-(devel|commits)=lists\.alioth\.debian\.org@mass\.madduck\.net$
-$BASE/.debian.mdadm/
+{ DEST=debian.mdadm }
 
 :0
 * ORIGINAL_TO ?? ^netconf-(devel|commits)=lists\.alioth\.debian\.org@mass\.madduck\.net$
-$BASE/.debian.netconf/
+{ DEST=debian.netconf }
 
 :0
 * ORIGINAL_TO ?? ^madduck=debian\.org@forward\.madduck\.net$
-$BASE/.debian/
+{ DEST=debian }
 
 # vim:ft=procmail
index 5f17bd64d95d685ed2f8f933fefeb96a8c5ee227..bb653a61e8f0760c95d2a4c89a7fad84459e1ae5 100644 (file)
@@ -1,10 +1,5 @@
 :0
 * ORIG_DOMAIN ?? ^r2e\.madduck\.net$
-{
-  DESTDIR=$BASE/.feeds
-
-  :0
-  ${DESTDIR}/
-}
+{ DEST=feeds }
 
 # vim:ft=procmail
index 59b6bd3ee9515b7a2d2c918fef946b71510023d3..35aa48decbb24d201e95cf04c1149e312388cfae 100644 (file)
@@ -1,10 +1,5 @@
 :0
 * ORIG_DOMAIN ?? ^mass\.madduck\.net$
-{
-  DESTDIR=$BASE/.mass
-  
-  :0
-  ${DESTDIR}/
-}
+{ DEST=mass }
 
 # vim:ft=procmail
index 28e4e32e179ed5a06e984e0edec5e16709e171a5..3ce55b4b6fff2744ef9b592255cc23576c5ccf88 100644 (file)
@@ -1,5 +1,5 @@
 :0
 * ORIGINAL_TO ?? ^m(artin\.)?krafft@sudetia\.de$
-$BASE/.sudetia/
+{ DEST=sudetia }
 
 # vim:ft=procmail
index e88e8f9b19b271ee831e278ab20521ba80095659..a2b1d89d969ec83725018dc33b395fa379b0475d 100644 (file)
@@ -17,7 +17,7 @@
   RE_UL_DOMAIN
 
   :0
-  $BASE/.ul/
+  { DEST=ul }
 }
 
 # vim:ft=procmail
index 9e88642e942f76a32de62fad70bb7bad5e5f13cb..37c3c33297f968ecd20fe4f5a0d799d12db20205 100755 (executable)
@@ -46,6 +46,14 @@ PMDIR=${PMDIR:-$HOME/.etc/mailfilter/procmail}
   { LOG="spamfilter:  skipping resubmitted message$NL" }
 }
 
+# do not run spamfilters if the message destination is already set
+:0 E
+* DEST ?? .
+{
+  LOG="spamfilter:  message already routed to '$DEST'$NL"
+  SPAM_UNKNOWN=already-destined
+}
+
 # let earlier parts of the mailfilter cause bypassing the checks
 :0 E
 * SKIP_SPAMCHECKS ?? .
@@ -81,6 +89,8 @@ PMDIR=${PMDIR:-$HOME/.etc/mailfilter/procmail}
 # now run the spamfilters
 :0 E
 {
+  INCLUDERC=$PMDIR/spamtraps
+  INCLUDERC=$PMDIR/spammers
   INCLUDERC=$PMDIR/pre-spam-cleanup
 
   # crm114
index 672358daf66a82c5557b57f6f644fed95f279737..363efb77f5811e8dc8c95a4cae2170bc99a2cb5c 100644 (file)
@@ -1,4 +1,5 @@
 :0
+* ! DEST ?? .
 * ORIGINAL_TO ?? ^.+@tickle\.madduck\.net$
 * ORIGINAL_TO ?? ^\/[^@]+
 {
index e73c8f1b2c447de4da9581b7449870e5877ca00b..59df5cc0753ac7d1482e7f2f96e947f6e38f5535 100644 (file)
@@ -7,7 +7,7 @@
   {
     LOG="gmail:       archiving message $MSGID with gmail$NL"
     SENDMAILFLAGS="$SENDMAILFLAGS -f $ID"
-    TRAP=""
+    TRAP
 
     :0
     ! martin.krafft@gmail.com