I like the answer above (with 0 votes; can't help, reputation = 1).
I was having exactly this problem, and didn't like the idea of temp and autosaves accumulating locally, even if offlineimap didn't sync them. What I did was prepend an rm
statement to the mu4e-get-mail-command
variable set in ~/.emacs
.
This assumes you're using maildir format locally. So for me, with offlineimap and an otherwise typical GmailMailDir setup, this was:
(setq mu4e-get-mail-command "rm -f ~/.mail/\[Gmail\].Drafts/cur/*~ ; rm -f ~/.mail/\[Gmail\].Drafts/cur/cur/\#* ; /usr/local/bin/offlineimap -o")
in my ~/.emacs
. This catches the temp files (affixed with ~
) and autosaves (bracketed with #
).
There are two drawbacks:
1. Your emacs buffer temp and autosaves for drafts will be deleted every time you check your mail.
2. If you have silly drafts already synced, they'll back-sync to your local repo (and not look like emacs buffer autosaves). I had to delete mine on Gmail.
If you wanted to "replicate" the better answer above in a Bash way instead of emacs, you could change this strategy to an mv
instead of an rm
.