I use Emacs and mu4e for email. I set up multiple accounts as in the manual. I also included this snippet from here to send deleted messages to a folder instead of deleting them permanently:
(add-to-list 'mu4e-marks
'(trash
:char ("d" . "▼")
:prompt "dtrash"
:dyn-target (lambda (target msg) (mu4e-get-trash-folder msg))
:action (lambda (docid msg target)
(mu4e~proc-move docid
(mu4e~mark-check-target target) "-N"))))
The problem is that all deleted messages are marked to go to the Trash of the main account instead of the Trash of their own account. Running help on key d
shows:
d runs the command mu4e-headers-mark-or-move-to-trash (found in mu4e-headers-mode-map), which is an interactive compiled Lisp function in ‘/usr/local/Cellar/mu/1.4.1/share/emacs/site-lisp/mu/mu4e/mu4e-headers.el’. It is bound to d, . (mu4e-headers-mark-or-move-to-trash)
which in turn shows:
mu4e-headers-mark-or-move-to-trash is an interactive compiled Lisp function in ‘/usr/local/Cellar/mu/1.4.1/share/emacs/site-lisp/mu/mu4e/mu4e-headers.el’. It is bound to d, . (mu4e-headers-mark-or-move-to-trash) Mark message for "move" to the trash folder if the message maildir matches any regexp in ‘mu4e-move-to-trash-patterns’. Otherwise mark with the "trash" flag. Also see ‘mu4e-view-mark-or-move-to-trash’.
The variable mu4e-move-to-trash-patterns
is set to nil
, and mu4e-view-mark-or-move-to-trash
shows:
mu4e-view-mark-or-move-to-trash is an interactive compiled Lisp function in ‘/usr/local/Cellar/mu/1.4.1/share/emacs/site-lisp/mu/mu4e/mu4e-view.el’. (mu4e-view-mark-or-move-to-trash &optional N) See ‘mu4e-headers-mark-or-move-to-trash’.
How can I send each message to the trash of its own mailbox?