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

Re: Send hook and shell scripts?



* 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.

For example:

: set sendmail="~/bin/mutt-sendmail"

$ cat ~/bin/mutt-sendmail
#!/bin/sh
## ROT13 the message body (not headers) and mail
(
        while read line; do
                echo $line
                if [ "$line" = "" ]; then
                        # All 'tr's are not created equal :P
                        tr 'A-Za-z' 'N-ZA-Mn-za-m'      # until eof
                        #tr '[A-Z][a-z]' '[N-Z][A-M][n-z][a-m]' # until eof
                        break
                fi
        done
) | /usr/lib/sendmail -oi -oem

-- 
 -D.    dgc@xxxxxxxxxxxx        NSIT    University of Chicago