From 56d680efdfd63496120528e55b312b1b6f840f65 Mon Sep 17 00:00:00 2001 From: Adrian Roth Date: Mon, 7 Jan 2019 14:05:30 +0100 Subject: [PATCH] Shortcut to archive email If an archive mailbox is found during redetected mailboxes, "a" will be used as shortcut to save-message to this mailbox and automatically accept the append notification. To use its macro is set to noop in the autoconf/mutt_profile. --- autoconf/mutt_profile | 1 + mutt-wizard.sh | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/autoconf/mutt_profile b/autoconf/mutt_profile index a96c93a..b288a6a 100644 --- a/autoconf/mutt_profile +++ b/autoconf/mutt_profile @@ -18,4 +18,5 @@ set ssl_force_tls = yes bind index,pager gg noop bind index,pager g noop bind index gg first-entry +bind index,pager noop unmailboxes * diff --git a/mutt-wizard.sh b/mutt-wizard.sh index 4b8a075..3ca56b4 100755 --- a/mutt-wizard.sh +++ b/mutt-wizard.sh @@ -64,6 +64,11 @@ formatShortcut() { \ echo "macro index,pager g$1 \"$data\" \"Go to $2.\"" >> "$muttdir"/accounts/$3.muttrc done ;} +formatMoveEmailShortcut() { \ + while read data; do + echo "macro index,pager $1 \"$data\" \"Save message to $2.\"" >> "$muttdir"/accounts/$3.muttrc + done ;} + gen_delim() { \ delim="=" for i in `seq $(( $1 - 1 ))` @@ -87,7 +92,9 @@ detectMailboxes() { \ grep -i /tmp/$1_boxes -e trash | sed 1q | formatShortcut t trash $1 grep -i /tmp/$1_boxes -e spam | sed 1q | formatShortcut S spam $1 grep -i /tmp/$1_boxes -e junk | sed 1q | formatShortcut j junk $1 - grep -i /tmp/$1_boxes -e archive | sed 1q | formatShortcut a archive $1 + archive_box=$(grep -i /tmp/$1_boxes -e archive | sed 1q) + echo $archive_box | formatShortcut a archive $1 + echo $archive_box | formatMoveEmailShortcut a archive $1 spoolfile=$(grep -i /tmp/$1_boxes -e inbox | sed -e 's/=/+/g' | sed 1q) record=$(grep -i /tmp/$1_boxes -e sent | sed -e 's/=/+/g' | sed 1q) postponed=$(grep -i /tmp/$1_boxes -e draft | sed -e 's/=/+/g' | sed 1q)