summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2014-08-21 17:28:34 +0200
committertv <tv@shackspace.de>2014-08-21 17:28:34 +0200
commit0e9851a7ac4ef58686c7704dcb13ddfa54cc76b2 (patch)
treef44849dabe94e2eb504a0f2745d9d9172d265ad9
parentad6919804b89647c9db3f37c503103950be32071 (diff)
wu-user: add bin/rm-killed-mail
-rwxr-xr-xwu-user/bin/rm-killed-mail21
1 files changed, 21 insertions, 0 deletions
diff --git a/wu-user/bin/rm-killed-mail b/wu-user/bin/rm-killed-mail
new file mode 100755
index 0000000..b8c7ae8
--- /dev/null
+++ b/wu-user/bin/rm-killed-mail
@@ -0,0 +1,21 @@
+#! /bin/sh
+set -euf
+
+if ! notmuch search tag:killed | grep -q . ; then
+ echo 'no killed mail; abort.'
+ exit 1
+fi
+
+notmuch search tag:killed
+printf 'want do rm these mail? [y/N] '
+read REPLY
+case "$REPLY" in
+ y|Y) :;; # continue
+ *)
+ echo 'abort.'
+ exit 2
+ ;;
+esac
+
+notmuch search --output=files tag:killed | xargs -l rm -v
+notmuch new