Rename inbox to flag to sync it and bogofilter spam

This commit is contained in:
Felix Van der Jeugt 2020-11-14 14:36:43 +01:00
parent 0030cd4860
commit 3915f133fd
No known key found for this signature in database
GPG key ID: 58B209295023754D
6 changed files with 42 additions and 36 deletions

View file

@ -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