Closed 88-percent closed 1 month ago
Acutally, for me, do step 1->5 then 6b. send mail
the mail is sent with the timestamp of the creation of the email (step 1)
edit: this might be a feature or a bug, I don't know...
Acutally, for me, do step 1->5 then 6b. send mail
the mail is sent with the timestamp of the creation of the email (step 1)
edit: this might be a feature or a bug, I don't know...
What version are you on? I ask because I experienced this exact issue when I was using the version of mu included with my distro. After upgrading to 1.12 I now get the correct timestamp for drafts. Even drafts edited multiple times present with the updated timestamp.
It's now only after calling M-x message-kill-buffer
while editing a draft message that the timestamp fails to update on my system.
I pushed a change that hopefully address this... does it work for you?
What version are you on?
I must admit I reverted back to 1.10.8 (shame on me)... I actually find this version slightly more friendly. (no encoding errors, reply to all, attachments work more smoothly)
sorry for my ignorance, but can I just drop the lisp from your commit in mu4e-draft.el
or should I pull and recompile mu to try this out?
@88-percent: either should work, thanks!
I tried adding the lisp to my mu4e-draft.el
but this doesn't seem to have solved the issue for me: if edits are discarded using M-x message-kill-buffer
the timestamp still doesn't seem to update on next edit.
I've noticed the function is different from the most recent version. If you think this could be caused by the fact that I'm a version behind (I'm on 1.12.5) I could try and upgrade to master. Just let me know and I'll do my best to help out. I also tried dropping the entire mu4e-draft.el
in place but it seems that it doesn't want to play nicely with the rest of my version.
Here's how the function looks in my edited version of mu4e-draft.el
(defun mu4e--compose-before-send ()
"Function called just before sending a message."
;; Remove References: if In-Reply-To: is missing.
;; This allows the user to effectively start a new message-thread by
;; removing the In-Reply-To header.
(when (eq mu4e-compose-type 'reply)
(unless (message-field-value "In-Reply-To")
(message-remove-header "References")))
(when use-hard-newlines
(mu4e--send-harden-newlines))
;; TEST new draft fix from https://github.com/djcb/mu/commit/413c03ea1cc9e1f1139a826f357d26f7bb6b6d33
;; in any case, make sure to save the message; this will also trigger
;; before/after save hooks, which fixes up various fields.
(set-buffer-modified-p t)
(save-buffer)
;; now handle what happens _after_ sending; typically, draft is gone and
;; the sent message appears in sent. Update flags for related messages,
;; i.e. for Forwarded ('Passed') and Replied messages, try to set the
;; appropriate flag at the message forwarded or replied-to.
(add-hook 'message-sent-hook
(lambda ()
(when-let ((fcc-path (message-field-value "Fcc")))
(mu4e--set-parent-flags fcc-path)
;; we end up with a ((buried) buffer here, visiting the
;; fcc-path; not quite sure why. But let's get rid of it (#2681)
(when-let ((buf (find-buffer-visiting fcc-path)))
(kill-buffer buf))
;; remove draft
(when-let ((draft (buffer-file-name)))
(mu4e--server-remove draft))))
nil t))
I take it back. It seems like the change is working. Thanks!
The timestamp displayed after calling M-x mu4e-compose-edit
is still the incorrect (old) timestamp, which is what was confusing me.
But the timestamp now seems to be updated correctly upon send. This is all I really need.
I've only had a brief amount of time to test this, but wanted to report it as soon as I noticed it. I'll keep an eye open to see if the behavior is consistent and report back.
Okay, thank you! Closing as fixed.
Describe the bug
Date field for draft messages doesn't reliably update for a very specific use case: where a draft message has discarded edits.
This causes these messages to display an incorrect date upon send - including to recipient.
How to Reproduce
M-x mu4e-compose-new
)M-x message-dont-send
)-- practically some time would elapse here --
M-x mu4e-compose-edit
)M-x message-kill-buffer
)message modified; kill anyway? (y or n)
- yremove the backup file too? (y or n)
- y-- practically some time would elapse here --
M-x mu4e-compose-edit
)Expected behavior: the message is opened in compose mode with all info the same as when it was saved except the date field which should be populated with the current time & date.
Actual behavior: the message is opened in compose mode with all info the same as when it was last saved - including the date field which is the time and date the message was last saved.
Environment
Emacs: 29.4 Spacemacs: 0.999 mu: 1.12.5 OS: Pop!OS 22.04
Checklist
master
(otherwise please upgrade)I'm running Spacemacs so I'm unfortunately unable to disable Evil for testing. I've tried to run the above without using evil commands.