From c5e40bfd2f24b26fb0ac8f6a60c3b3a810cc8f9b Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Sun, 4 Nov 2018 22:56:53 +0100 Subject: astroid: Add configs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Johannes Löthberg --- astroid/hooks/toggle-email-learn-spam | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 astroid/hooks/toggle-email-learn-spam (limited to 'astroid/hooks/toggle-email-learn-spam') diff --git a/astroid/hooks/toggle-email-learn-spam b/astroid/hooks/toggle-email-learn-spam new file mode 100755 index 0000000..ae8d9d9 --- /dev/null +++ b/astroid/hooks/toggle-email-learn-spam @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# +# $1 Message ID to toggle tag on + +if [[ "$(notmuch search id:$1 and tag:learn-spam)" ]]; then + printf "unsetting tag learn-spam from message %s\n" "$1" + notmuch tag -learn-spam +inbox id:"$1" +else + printf "setting tag learn-spam from message %s\n" "$1" + notmuch tag +learn-spam -inbox id:"$1" +fi -- cgit v1.2.3-70-g09d2