]> git.madduck.net Git - etc/mailfilter.git/blobdiff - bin/kill-from

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:

skip spamchecks for greenpeace
[etc/mailfilter.git] / bin / kill-from
index 344418515ac66f5c3066de9ef5fe5be8f8b57dcd..396d23ba1bf7c0acb8c665b8c70acd93a751b78a 100755 (executable)
@@ -1,7 +1,8 @@
 #!/bin/sh
 set -eu
 
-IGNORE_FILE="${0%/*}/../config/ignore"
+CONFIG_DIR="${0%/*}/../config"
+IGNORE_FILE="$CONFIG_DIR/ignore"
 ME="${0##*/}"
 
 case "$ME" in
@@ -19,8 +20,8 @@ case "$ME" in
     esac
     CHECKPREFIX='From: someone <'
     CHECKPOSTFIX='>'
-    REPREFIX='^From:.*'
-    REPOSTFIX=''
+    REPREFIX='^From:.*\<'
+    REPOSTFIX='\>'
     ARG="$1"
     ;;
   kill-thread)
@@ -35,10 +36,10 @@ case "$ME" in
         exit 2
         ;;
     esac
-    CHECKPREFIX='References: <something> '
+    CHECKPREFIX='References: <something> <'
     CHECKPOSTFIX='>'
-    REPREFIX='^References:.*'
-    REPOSTFIX=''
+    REPREFIX='^References:.*\<'
+    REPOSTFIX='\>'
     ARG="${1#<}"; ARG="${ARG%>}"
     ;;
 esac
@@ -50,6 +51,9 @@ fi
 
 ARG_ESCAPED="$(echo "$ARG" | sed -re 's,([.+]),\\\1,g')"
 cat <<_eof >> $IGNORE_FILE
-$^# $(date +%Y.%m.%d.%H.%m.%S) added by ${0##*/}
+$^# added by $ME @$(date +%s)
 $REPREFIX$ARG_ESCAPED$REPOSTFIX
 _eof
+
+cd $CONFIG_DIR
+git-commit -m"$ME $1" ${IGNORE_FILE##*/}