2

When replying to some certain emails, I usually have to add other recipients to the list. But unfortunately, I often forget to do so.

Thus, my question: is it possible that after leaving the editor and arriving at Mutt's Compose section (where you can actually add someone with t or c hotkeys), there would be some kind of additional message in the status line? Or [dependent on the recipients list] some script could be launched? Or any other idea that jumps to you? Something with the hooks may be? (Not that I know much about them.)

So, would be very grateful for any hint here :) (I already tried to play with the editor itself, to launch an external script when leaving it. But it gets very noisy: I need this kind of reminder only if contacting certain people, actually, and I can't add them blindly or always, too).

2
  • 2
    probably a set editor=somethingcustom wrapper that then runs the real editor then parses what that editor returned for the addresses you want to warn on (or automatically adds said recipients, maybe)
    – thrig
    Oct 5, 2018 at 13:55
  • Thanks, @thrig, in some sense you were right -- I now added the solution that seems be working for me.
    – A S
    Oct 5, 2018 at 17:35

1 Answer 1

2

As pointed out in Mutt mailing list, set edit_headers can actually be the solution here.

Because of this preference, email addresses will be present in the editor while editing the message. Which means that if your editor for composing emails is Vim, then you can create something like this (and add it to $VIMHOME/ftdetect/mail.vim):

autocmd BufEnter *mutt-* call BeAware()
function BeAware()
    if search('[email protected]')
        !alert 'Add Y, Z'
    endif
endfunction

Which will launch an external script alert with some message if this specific string '[email protected]' will be present in this Vim's buffer.

Works for me :).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .