Merge pull request #1190 from jwhitbeck/master

mu4e: ensure sent dir is created with proper maildir structure
This commit is contained in:
Dirk-Jan C. Binnema 2018-02-09 22:52:56 +02:00 committed by GitHub
commit 0fe234c3ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -287,6 +287,12 @@ If needed, set the Fcc header, and register the handler function."
(lexical-let ((maildir mdir) (old-handler message-fcc-handler-function))
(lambda (file)
(setq message-fcc-handler-function old-handler) ;; reset the fcc handler
(let ((mdir-path (concat mu4e-maildir maildir)))
;; Create the full maildir structure for the sent folder if it doesn't exist. `mu4e~proc-mkdir`
;; runs asynchronously but no matter whether it runs before or after `write-file`, the sent
;; maildir ends up in the correct state.
(unless (file-exists-p mdir-path)
(mu4e~proc-mkdir mdir-path)))
(write-file file) ;; writing maildirs files is easy
(mu4e~proc-add file (or maildir "/")))))))) ;; update the database