From e0c0130e6af3a887b5b3c2dfeb3142266cc3c174 Mon Sep 17 00:00:00 2001 From: Koren He Date: Sat, 2 Jun 2018 14:59:20 +0800 Subject: [PATCH] Fix wrong detection for inbox folder The function detectMailboxes() try explicitly excludes all folder names that are not inbox, but forget to exclude "Delete" or "Deleted Messages" folder. Outlook and some other mailboxes have this folder. Without this patch, "Delete" folder will be set incorrectly as inbox and spoolfile. --- mutt-wizard.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mutt-wizard.sh b/mutt-wizard.sh index 23ae7ab..01322ba 100755 --- a/mutt-wizard.sh +++ b/mutt-wizard.sh @@ -82,13 +82,13 @@ detectMailboxes() { \ sed -i "/^mailboxes\|^set spoolfile\|^set record\|^set postponed/d" "$muttdir"accounts/$1.muttrc echo mailboxes $oneline >> "$muttdir"accounts/$1.muttrc sed -i "/^macro index,pager g/d" "$muttdir"accounts/$1.muttrc - grep -vi /tmp/$1_boxes -e "trash\|drafts\|sent\|trash\|spam\|junk\|archive\|chat\|old\|new\|gmail\|sms\|call" | sort -n | sed 1q | formatShortcut i inbox $1 + grep -vi /tmp/$1_boxes -e "trash\|drafts\|sent\|trash\|spam\|junk\|archive\|chat\|old\|new\|gmail\|sms\|call\|delete" | sort -n | sed 1q | formatShortcut i inbox $1 grep -i /tmp/$1_boxes -e sent | sed 1q | formatShortcut s sent $1 grep -i /tmp/$1_boxes -e draft | sed 1q | formatShortcut d drafts $1 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 archive | sed 1q | formatShortcut a archive $1 - spoolfile=$(grep -vi /tmp/$1_boxes -e "trash\|drafts\|sent\|trash\|spam\|ham\|junk\|archive\|chat\|old\|new\|gmail\|sms\|call" | sort -n | sed 1q | sed -e 's/=/+/g') + spoolfile=$(grep -vi /tmp/$1_boxes -e "trash\|drafts\|sent\|trash\|spam\|ham\|junk\|archive\|chat\|old\|new\|gmail\|sms\|call\|delete" | sort -n | sed 1q | sed -e 's/=/+/g') 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) trash=$(grep -i /tmp/$1_boxes -e trash | sed -e 's/=/+/g' | sed 1q)