diff options
Diffstat (limited to 'mutt-wizard.sh')
-rwxr-xr-x | mutt-wizard.sh | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/mutt-wizard.sh b/mutt-wizard.sh index 1625267..d5092ee 100755 --- a/mutt-wizard.sh +++ b/mutt-wizard.sh @@ -43,14 +43,14 @@ detectMailboxes() { \ 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 -i /tmp/$1_boxes -e sent | formatShortcut s sent $1 - grep -i /tmp/$1_boxes -e draft | formatShortcut d drafts $1 - grep -i /tmp/$1_boxes -e trash | formatShortcut t trash $1 - grep -i /tmp/$1_boxes -e spam | formatShortcut S spam $1 - grep -i /tmp/$1_boxes -e archive | formatShortcut a archive $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\|junk\|archive\|chat\|old\|new\|gmail\|sms\|call" | sort -n | sed 1q | sed -e 's/=/+/g') - record=$(grep -i /tmp/$1_boxes -e sent | sed -e 's/=/+/g') - postponed=$(grep -i /tmp/$1_boxes -e draft | 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) echo "set spoolfile = \"$spoolfile\"" >> "$muttdir"accounts/$1.muttrc echo "set record = \"$record\"" >> "$muttdir"accounts/$1.muttrc echo "set postponed = \"$postponed\"" >> "$muttdir"accounts/$1.muttrc ;} @@ -149,6 +149,9 @@ addAccount() { shred -u /tmp/$title mv /tmp/$title.gpg ~/.config/mutt/credentials/ + # Adding directory structure for cache. + mkdir -p "$muttdir"accounts/$title/cache/bodies + # Creating the offlineimaprc if it doesn't exist already. if [ ! -f ~/.offlineimaprc ]; then cp "$muttdir"autoconf/offlineimap_header ~/.offlineimaprc; fi cat "$muttdir"autoconf/offlineimap_profile | sed -e "$replacement" >> ~/.offlineimaprc @@ -159,9 +162,6 @@ addAccount() { # Add a numbered shortcut in the muttrc echo "macro index,pager i$idnum '<sync-mailbox><enter-command>source "$muttdir"accounts/$title.muttrc<enter><change-folder>!<enter>'" >> "$muttdir"personal.muttrc - # Adding directory structure for cache. - mkdir -p "$muttdir"accounts/$title/cache/bodies - # Add to offlineimaprc sync list. sed -i "s/^accounts =.*[a-zA-Z]$/&, $title/g;s/^accounts =$/accounts = $title/g" ~/.offlineimaprc |