Browse Source

Fix wrong folder name when syncing inbox folder

As muttrc provides a shortcut 'o' for syncing inbox folders, different mailboxes
may not have the same folder name, we should overridden this command in each
account's muttrc file.

Otherwise, a mailbox which has 'INBOX' as its inbox folder will see this error:

ERROR: Account qq: no folder to sync (folderfilter issue?)
 *** Finished account 'qq' in 0:06
ERROR: Exceptions occurred during the run!
ERROR: Account qq: no folder to sync (folderfilter issue?)

This patch fix this problem.
pull/57/head
Koren He 6 years ago
parent
commit
ef4831eaf0
2 changed files with 4 additions and 1 deletions
  1. +3
    -1
      mutt-wizard.sh
  2. +1
    -0
      muttrc

+ 3
- 1
mutt-wizard.sh View File

@@ -82,7 +82,8 @@ 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\|delete" | sort -n | sed 1q | formatShortcut i inbox $1
inbox=$(grep -vi /tmp/$1_boxes -e "trash\|drafts\|sent\|trash\|spam\|junk\|archive\|chat\|old\|new\|gmail\|sms\|call\|delete" | sort -n | sed 1q | sed -e 's/=//g')
echo $inbox | 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
@@ -92,6 +93,7 @@ detectMailboxes() { \
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)
echo "macro index o \"<shell-escape>offlineimap -qf $inbox -a $1<enter>\" \"run offlineimap to sync inbox\"" >> "$muttdir"accounts/$1.muttrc
echo "set spoolfile = \"$spoolfile\"" >> "$muttdir"accounts/$1.muttrc
echo "set record = \"$record\"" >> "$muttdir"accounts/$1.muttrc
echo "set postponed = \"$postponed\"" >> "$muttdir"accounts/$1.muttrc


+ 1
- 0
muttrc View File

@@ -56,6 +56,7 @@ macro index \Cr "T~U<enter><tag-prefix><clear-flag>N<untag-pattern>.<enter>" "ma

#sync email
macro index O "<shell-escape>offlineimap<enter>" "run offlineimap to sync all mail"
#this will be overridden by each accout's .muttrc
macro index o "<shell-escape>offlineimap -qf INBOX<enter>" "run offlineimap to sync inbox"

#copy/move dialogs


Loading…
Cancel
Save