diff --git a/mu4e/mu4e-proc.el b/mu4e/mu4e-proc.el index b6a637cd..26dc18cf 100644 --- a/mu4e/mu4e-proc.el +++ b/mu4e/mu4e-proc.el @@ -376,6 +376,11 @@ The flags are any of `deleted', `flagged', `new', `passed', `replied' `seen' or `mu4e-string-to-flags' and `mu4e-flags-to-string'. The server reports the results for the operation through `mu4e-update-func'. + +If the the variable `mu4e-change-filenames-when-moving' is non-nil, +the move generates new names for the target files; this helps +certain tools (such as mbsync). + The results are reported through either (:update ... ) or (:error ) sexp, which are handled my `mu4e-update-func' and `mu4e-error-func', respectively." @@ -391,8 +396,9 @@ or (:error ) sexp, which are handled my `mu4e-update-func' and (path (when maildir (format " maildir:%s" (mu4e~proc-escape maildir))))) - (mu4e~proc-send-command "cmd:move %s %s %s" - idparam (or flagstr "") (or path "")))) + (mu4e~proc-send-command "cmd:move %s %s %s %s" + idparam (or flagstr "") (or path "") + (format "newname:%s" (if mu4e-change-filenames-when-moving "true" "false"))))) (defun mu4e~proc-index (path my-addresses) "Update the message database for filesystem PATH, which should diff --git a/mu4e/mu4e-vars.el b/mu4e/mu4e-vars.el index 2ec1f600..cf5eb5a9 100644 --- a/mu4e/mu4e-vars.el +++ b/mu4e/mu4e-vars.el @@ -71,6 +71,19 @@ mu4e." :group 'mu4e :safe 'integerp) + +(defcustom mu4e-change-filenames-when-moving nil + "When moving messages to different folders, normally mu/mu4e keep +the the base filename the same (the flags-part of the filename may +change still). With this option set to non-nil, mu4e instead +changes the filename. This latter behavior works better with some +IMAP-synchronization programs such as mbsync; the default works +better with e.g. offlineimap." + :type 'boolean + :group 'mu4e + :safe 'booleanp) + + (defcustom mu4e-attachment-dir (expand-file-name "~/") "Default directory for saving attachments. This can be either a string, or a function that takes a filename @@ -215,6 +228,7 @@ the From: address.)" :type 'string :group 'mu4e-compose) + ;; backward compatibility (make-obsolete-variable 'mu4e-reply-to-address 'mu4e-compose-reply-to-address "v0.9.9") diff --git a/mu4e/mu4e.texi b/mu4e/mu4e.texi index 471db30e..ac097fba 100644 --- a/mu4e/mu4e.texi +++ b/mu4e/mu4e.texi @@ -2913,6 +2913,11 @@ number of places. @item @emph{Can I start @t{mu4e} in the background?} Yes - if you provide a prefix-argument (@key{C-u}), @t{mu4e} starts, but does not show the main-window. +@item @emph{Some IMAP-synchronization programs such as @t{mbsync} (but not +@t{offlineimap}) don't like it when message files do not change their names +when they are moved to different folders. Can @t{mu4e} somehow accomodate +this?} Yes - you can set the variable @code{mu4e-change-filenames-when-moving} +to non-nil. @end enumerate @node Reading messages