Rename inbox to flag to sync it and bogofilter spam
This commit is contained in:
parent
0030cd4860
commit
3915f133fd
6 changed files with 42 additions and 36 deletions
|
@ -1,15 +1,13 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
mid="id:$1"
|
||||
file="$(notmuch show "$mid" | sed -n '1s/.*filename:\([^ ]*\).*/\1/p')"
|
||||
temp="$(mktemp)"
|
||||
|
||||
cat > "$temp" <<HERE
|
||||
References: <$1>
|
||||
HERE
|
||||
|
||||
alot compose --sender felix.vanderjeugt@ugent.be \
|
||||
--template="$temp" \
|
||||
--subject spam \
|
||||
--to spam@ugent.be \
|
||||
--attach "$file"
|
||||
for mid in $(notmuch search --output=messages tag:inbox "$@"); do
|
||||
printf "%s ? " "$(notmuch show "$mid" | sed -n 's/Subject: //p')"
|
||||
read ans
|
||||
case "$ans" in
|
||||
y*)
|
||||
notmuch show --format=raw "$mid" | bogofilter -Sn
|
||||
notmuch tag -inbox -unread +spam -- "$mid"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue