Drafts of the same message, accumulating

47 views
Skip to first unread message

Nicolas Richard

unread,
Jul 6, 2016, 8:53:30 AM7/6/16
to mu-discuss
Hello,

I've been observing an annoying behaviour for a long time and finally
took a closer look this morning. Here's what I have found :

When composing a new message, mu4e picks a filename for saving it to
disk as a draft. Let's say it's called `draftname`. Now if offlineimap
runs in the background, it will actually rename that file to something
else, behind emacs' back. If you save the same buffer again, it'll write
to the old name (`draftname`), hence creating a second file for the same
message.

Here's an example of a filename that got renamed :
1467805728.a37c58e0dd3aee73.localhost:2,DS
became, after a run of offlineimap :
1467806963_0.7963.localhost,U=247391,FMD5=f03ab16cd58372c77ba45a3d9a5a1cb9:2,DS
(I checked it's the same inode number).

Do you have any suggestion to avoid the problem ? i.e. avoid having
multiple drafts or at least have them removed when sending the message.

Btw here's a related emacs.sx question. I did not ask the question but I
commented on it as I think they're referring to the same problem :
http://emacs.stackexchange.com/questions/21723/how-can-i-delete-mu4e-drafts-on-successfully-sending-the-mail#comment37502_21723

--
Nicolas

Joost Kremers

unread,
Jul 6, 2016, 9:09:47 AM7/6/16
to mu-di...@googlegroups.com

On Wed, Jul 06 2016, Nicolas Richard wrote:
> I've been observing an annoying behaviour for a long time and finally
> took a closer look this morning. Here's what I have found :
>
> When composing a new message, mu4e picks a filename for saving it to
> disk as a draft. Let's say it's called `draftname`. Now if offlineimap
> runs in the background, it will actually rename that file to something
> else, behind emacs' back. If you save the same buffer again, it'll write
> to the old name (`draftname`), hence creating a second file for the same
> message.
>
> Here's an example of a filename that got renamed :
> 1467805728.a37c58e0dd3aee73.localhost:2,DS
> became, after a run of offlineimap :
> 1467806963_0.7963.localhost,U=247391,FMD5=f03ab16cd58372c77ba45a3d9a5a1cb9:2,DS
> (I checked it's the same inode number).
>
> Do you have any suggestion to avoid the problem ? i.e. avoid having
> multiple drafts or at least have them removed when sending the message.

For this very reason, I disabled auto-save in compose-mode buffers:

,----
| ;; disable auto-save for email: since I have set
| ;; auto-save-visited-file-name, auto-save seems to leave multiple copies of
| ;; a message in the drafts folder. this is not nice.
| (add-hook 'mu4e-compose-mode-hook #'(lambda () (auto-save-mode -1)))
`----

The comment claims it's dependent on `auto-save-visited-file-name` being
non-nil, but I don't remember what I did back then to test this. Do you
set this variable to t in your config?

I've long since reverted `auto-save-visited-file-name` to nil, because
it also caused problems with org-capture. Perhaps I should just try
removing that line from my config. ;-)


--
Joost Kremers
Life has its moments

Stephen Eglen

unread,
Jul 9, 2016, 3:23:57 PM7/9/16
to mu-discuss

,----
| ;; disable auto-save for email: since I have set
| ;; auto-save-visited-file-name, auto-save seems to leave multiple copies of
| ;; a message in the drafts folder. this is not nice.
| (add-hook 'mu4e-compose-mode-hook #'(lambda () (auto-save-mode -1)))
`----

Thank you for this -- I had noticed my Drafts folder filling up with auto-saved messages. 
Reply all
Reply to author
Forward
0 new messages