From 798aa12a34349c2f6ce7ead303637b75970b3b9d Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Sun, 20 Oct 2019 16:13:32 +0300 Subject: [PATCH] mu4e-compose: Generate message-id for drafts Ensure even drafts have a message-id, since the querying machinery wants that. --- mu4e/mu4e-compose.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el index 85ee2ab2..1ea85208 100644 --- a/mu4e/mu4e-compose.el +++ b/mu4e/mu4e-compose.el @@ -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