mu4e-compose: Generate message-id for drafts

Ensure even drafts have a message-id, since the querying machinery wants
that.
This commit is contained in:
Dirk-Jan C. Binnema 2019-10-20 16:13:32 +03:00
parent 548dc16f67
commit 798aa12a34
1 changed files with 5 additions and 1 deletions

View File

@ -298,9 +298,13 @@ If needed, set the Fcc header, and register the handler function."
(defun mu4e~compose-register-message-save-hooks ()
"Just before saving, we remove the `mail-header-separator'.
Just after saving we restore it; thus, the separator should never
appear on disk."
appear on disk. Also update the Date and ensure we have a
Message-ID."
(add-hook 'before-save-hook
(lambda()
;; replace the date
(message-remove-header "Date")
(message-generate-headers '(Date Message-ID))
(save-match-data
(mu4e~draft-remove-mail-header-separator))) nil t)
(add-hook 'after-save-hook