14.7 Org-mode

Org-mode is a popular and powerful way to deal with todo-lists, agendas inside Emacs. It’s only natural to integrate it with mu4e, and

14.7.2 Tracking sent mail

To build on the above, it can be useful to automatically track outgoing e-mail so you can follow-up later.

One way to do this is to first add a template to org-capture-templates:

("wm" "To-do" entry (file+headline "~/Org/todo.org" "Waiting for")
 "* WAIT [[mu4e:msgid:%(eval sent-message-id)][%(eval sent-subject)]]\n\t%u"
 :immediate-finish t)

Then invoke this template from sent-hook:

(defun my-org-wait-for-sent-mail ()
  "Capture the outgoing mail."
  (interactive)
  (let* ((sent-message-id
          (replace-regexp-in-string
           "[<>]" "" (message-fetch-field "Message-Id")))
         (sent-subject (or (message-fetch-field "Subject") "No subject")))
    (org-capture nil "wm")))

(add-hook 'sent-hook #'my-org-wait-for-sent-mail)

All of the above likely needs tweaking for your particular setup, but should hopefully give some inspiration.