aboutsummaryrefslogtreecommitdiff
path: root/mutt-notmuch-tag
blob: 9b80a19891c4c0def40e79fc290ea93718704bb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# mutt-notmuch-tag.sh
# Simple and crude script to tag multiple messagess in mutt using notmuch.
# See http://upsilon.cc/~zack/blog/posts/2011/01/how_to_use_Notmuch_with_Mutt/

grep "Message-ID" - > temp.txt
sed -e 's|Message-ID:.*<\(.*\)>.*|id:\1|' temp.txt > temp1.txt
sed '{:q;N;s/\n/ OR /g;t q}' temp1.txt > temp2.txt

## When vi opens up list the tagging commands, e.g. +tag1 -tag2
vi tags.txt

TAGS=`cat tags.txt`
SEARCHEXPR=`cat temp2.txt`

## For debugging
echo "notmuch tag $TAGS -- $SEARCHEXPR" >> temp2.txt

## Now apply the tags
notmuch tag $TAGS -- $SEARCHEXPR

# End of mutt-notmuch-tag.sh