<<< Date Index >>>     <<< Thread Index >>>

Re: Send hook and shell scripts?



Cameron Simpson wrote:
> 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.


I would like the sendhook to check characteristics of the recipient
list to set such things as fcc folder and encryption.  

Also, sometimes I have a need to filter the text of emails I send
out-- insert standard paragraphs (slightly modified by the script),
etc.

This is more of a wishlist feature than anything else.  I can
accomplish what I'm looking for via emacs and other entry points.  I
was just hoping for something simple.

Thanks all.


-- 
GPG Fingerprint: E8B0 8163 C9DF 6C91 4567  895C 090F 1B45 87ED 9963

Attachment: pgpuMLygyguLR.pgp
Description: PGP signature