Re: Send hook and shell scripts?
On 25Apr2006 10:43, David Champion <dgc@xxxxxxxxxxxx> wrote:
| * On 2006.04.24, in <20060425041301.GG9164@xxxxxxxxxxxxxx>,
| * "James" <james@xxxxxxxxxxxxxx> wrote:
| > Instead of a send-hook matching a pattern, I'd like mutt to pass the
| > email to a shell script and match based on the return code of the
| > script. I don't see anyhting in the documentation about sucha
| > feature. Perhaps I missed it. anybody know how to do this?
|
| The usual approach for this kind of thing is to set $sendmail to a
| script that does whatever you need, then runs sendmail or another MSA.
| It's not equivalent, but it might be sufficient for your needs.
[...]
I was going to suggest this except that it happens on dispatch, which
send-hook happens just before compose if I'm reading correctly.
You can do a lot of stuff with $sendmail - I use it to divert
"news.group@usenet" off into NNTP (headers munged to match)
and to do some extra FCC stuff (I want more than one FCC).
However, but the time it's in action it's too late for the author to
tweak; send-hook lets you set up headers and stuff before composition,
leaving it possible to readjust them if your needs are atypical.
I imagine using autoedit=yes and edit_headers=yes and a special setting
for $editor could achieve the same thing as send-hook - have the $editor
program do stuff based on the new message contents and then run your real
editor. I fear it would be prone to rehacking things if you quit the
editor and re-entered it; you'd want some state floating around to say
"I've already done this".
Jason, maybe you'd better go into some detail about what you're
wanting to do with the send-hook.
Cheers,
--
Cameron Simpson <cs@xxxxxxxxxx> DoD#743
http://www.cskk.ezoshosting.com/cs/
Frank, bring me a ball-peen hammer and your skull.