mu4e: improve mail-retrieval error handling

Add two new customization variables:
  mu4e-index-update-error-continue
  mu4e-index-update-error-warning

With these, we can configure what happens when the mail-retrieval
program finishes with a non-zero exit code.

Make the default to warn but continue; it seems quite some users got
bitten by the old behavior of not updating after an error (which may
only be a pseudo-error). offlineimap/mbsync do not document their exit
codes very well, unlike fetchmail.

Also update manual for this.
This commit is contained in:
djcb
2014-11-30 11:27:41 +02:00
parent 46425c201b
commit 664431bf8c
3 changed files with 136 additions and 87 deletions

View File

@ -57,18 +57,31 @@ link."
(defcustom mu4e-get-mail-command "true"
"Shell command to run to retrieve new mail.
Common values are \"offlineimap\" and \"fetchmail\", but you use
arbitrary shell-commands.
If you set it to \"true\" (the default), the command won't don't
anything, which is useful if you get your mail without the need to
explicitly run any scripts, for example when running yout own
mail-server.
"
Common values are \"offlineimap\", \"fetchmail\" and \"mbsync\",
but you use arbitrary shell-commands. If you set it to
\"true\" (the default), the command won't don't anything, which is
useful if you get your mail without the need to explicitly run any
scripts, for example when running yout own mail-server."
:type 'string
:group 'mu4e
:safe 'stringp)
(defcustom mu4e-index-update-error-warning t
"Whether to display warnings when we the retrieval process (as
per `mu4e-get-mail-command') finished with a non-zero exit code."
:type 'boolean
:group 'mu4e
:safe 'booleanp)
(defcustom mu4e-index-update-error-continue t
"Whether to continue with indexing when we the retrieval
process (as per `mu4e-get-mail-command') finished with a non-zero
exit code."
:type 'boolean
:group 'mu4e
:safe 'booleanp)
(defcustom mu4e-update-interval nil
"Number of seconds between automatic calls to retrieve mail and
update the database. If nil, don't update automatically. Note,