Skip to content

Instantly share code, notes, and snippets.

@areina
Created October 30, 2013 10:54
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save areina/7230684 to your computer and use it in GitHub Desktop.
Save areina/7230684 to your computer and use it in GitHub Desktop.
mu4e - Dynamic trash folder for multiple accounts
(defun custom-mu4e-trash-folder (msg)
(if msg
(cond
((string-match "foo@gmail.com" (mu4e-message-field msg :maildir))
"/foo0@gmail.com/[Gmail].Trash")
((string-match "foo@3scale.net" (mu4e-message-field msg :maildir))
"/foo@3scale.net/[Gmail].Trash"))
(mu4e-ask-maildir-check-exists "Save message to maildir: ")))
(setq mu4e-trash-folder 'custom-mu4e-trash-folder)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment