From 00657932cdb01724cc87ddc98f5b4a3f6126a5aa Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 31 Dec 2014 09:44:07 -0500 Subject: [PATCH] Fixing up mu4e sync to work on multiple mail folders. --- dotfiles/lib/shellenv/mu4e.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dotfiles/lib/shellenv/mu4e.sh b/dotfiles/lib/shellenv/mu4e.sh index 12f24446..e5e2ead6 100644 --- a/dotfiles/lib/shellenv/mu4e.sh +++ b/dotfiles/lib/shellenv/mu4e.sh @@ -1,7 +1,6 @@ -MAILDIR="$HOME/Mail/INBOX/" +MAILDIR="$HOME/Mail/" SYNC_STAMP="$HOME/.mail-sync" APP_ICON="$(dotfiles_directory)/resources/gmail_logo.png" -SYNC_COMMAND="offlineimap -f INBOX" TIMEOUT="60" function mu4e_alert_for_filename { @@ -19,11 +18,7 @@ function mu4e_alert_for_filename { } function mu4e_update_mail { - timeout $TIMEOUT zsh -c "_mu4e_update_mail" -} - -function _mu4e_update_mail { - eval $SYNC_COMMAND + # mail_sync_command "$@" if test -z "$(find "$MAILDIR" -cnewer "$SYNC_STAMP" -a -type f)"; then echo "$(date) - No new messages, skipping alerting and indexing." else @@ -32,6 +27,12 @@ function _mu4e_update_mail { fi } +function mail_sync_command { + local flags='' + test -z "$*" || flags="-f $@" + timeout $TIMEOUT offlineimap $flags +} + function mu4e_update_index { execute_elisp "(mu4e-update-index)" }