summaryrefslogtreecommitdiffstats
path: root/wu-user/bin/rm-killed-mail
blob: b8c7ae8f5e5a5781fcaf8294a50501b9fe9291dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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