Fixing up mu4e sync to work on multiple mail folders.

This commit is contained in:
Ivan Malison 2014-12-31 09:44:07 -05:00
parent 66a1b7b595
commit 00657932cd

View File

@ -1,7 +1,6 @@
MAILDIR="$HOME/Mail/INBOX/" MAILDIR="$HOME/Mail/"
SYNC_STAMP="$HOME/.mail-sync" SYNC_STAMP="$HOME/.mail-sync"
APP_ICON="$(dotfiles_directory)/resources/gmail_logo.png" APP_ICON="$(dotfiles_directory)/resources/gmail_logo.png"
SYNC_COMMAND="offlineimap -f INBOX"
TIMEOUT="60" TIMEOUT="60"
function mu4e_alert_for_filename { function mu4e_alert_for_filename {
@ -19,11 +18,7 @@ function mu4e_alert_for_filename {
} }
function mu4e_update_mail { function mu4e_update_mail {
timeout $TIMEOUT zsh -c "_mu4e_update_mail" # mail_sync_command "$@"
}
function _mu4e_update_mail {
eval $SYNC_COMMAND
if test -z "$(find "$MAILDIR" -cnewer "$SYNC_STAMP" -a -type f)"; then if test -z "$(find "$MAILDIR" -cnewer "$SYNC_STAMP" -a -type f)"; then
echo "$(date) - No new messages, skipping alerting and indexing." echo "$(date) - No new messages, skipping alerting and indexing."
else else
@ -32,6 +27,12 @@ function _mu4e_update_mail {
fi fi
} }
function mail_sync_command {
local flags=''
test -z "$*" || flags="-f $@"
timeout $TIMEOUT offlineimap $flags
}
function mu4e_update_index { function mu4e_update_index {
execute_elisp "(mu4e-update-index)" execute_elisp "(mu4e-update-index)"
} }