Skip to content

Commit

Permalink
Merge pull request #2698 from josephmturner/fix-mu4e--fcc-path
Browse files Browse the repository at this point in the history
Fix: Put sent mail in correct location when `mu4e-sent-messages-behavior` is a function
  • Loading branch information
djcb authored Apr 25, 2024
2 parents 0f0d218 + f00ca68 commit bbd949e
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions mu4e/mu4e-compose.el
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,19 @@ base filename without any Maildir decoration.
Returns the path for the sent message, either in the sent or
trash folder, or nil if the message should be removed after
sending."
(when-let ((sent-dir
(pcase mu4e-sent-messages-behavior
('delete nil)
('trash (mu4e-get-trash-folder parent))
('sent (mu4e-get-sent-folder parent))
((pred functionp) (funcall mu4e-sent-messages-behavior))
(_ (mu4e-error "Error in `mu4e-sent-messages-behavior'")))))
(when-let ((sent-behavior
;; We can't call `functionp' since at least 'delete is a function.
(pcase mu4e-sent-messages-behavior
((or 'delete 'trash 'sent) mu4e-sent-messages-behavior)
((pred functionp mu4e-sent-messages-behavior)
(funcall mu4e-sent-messages-behavior))
(_ mu4e-sent-messages-behavior)))
(sent-dir
(pcase sent-behavior
('delete nil)
('trash (mu4e-get-trash-folder parent))
('sent (mu4e-get-sent-folder parent))
(_ (mu4e-error "Error in `mu4e-sent-messages-behavior'")))))
(mu4e-join-paths
(mu4e-root-maildir) sent-dir "cur"
(format "%s%s2,S" base-name mu4e-maildir-info-delimiter))))
Expand Down

0 comments on commit bbd949e

Please sign in to comment.