X-Git-Url: https://git.madduck.net/etc/mailfilter.git/blobdiff_plain/5af333ca3b83425e5cb3aa704b37654d576856c1..700c128727523a5d4535a4e40b0204bf3e1df2c4:/bin/kill-from diff --git a/bin/kill-from b/bin/kill-from index 3444185..396d23b 100755 --- a/bin/kill-from +++ b/bin/kill-from @@ -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: ' + CHECKPREFIX='References: <' 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##*/}