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

Re: Pipe to Modify a Message



Am 2003-11-14 11:15:47, schrieb Phil!Gregory:
>I'd like to have a macro that removes all spamassassin added things on an
>email.  'spamassassin -d' does this, but I haven't been able to figure a
>way to alter a message by piping it to an external command.  The closest
>I've come so far is
>
>  <pipe-message>spamassassin -d >> current-mailbox-here<delete-message>
>
>which I don't really like for a number of reasons.  Any better
>suggestions?

Why not use procmail and a small bash-script ?

------------------------------------------------------------------------
:0 fwhb
* ^To.*binaries4michelle@xxxxxxxxxx
* ^Subject.*\[XXX\]
| /home/michelle/bin/myXXXbashscript
------------------------------------------------------------------------

and the script works like this:

------------------------------------------------------------------------
#!/bin/bash
cat /dev/stdin > /tmp/test_file
    ...work on this file as you want > /tmp/test_output
cat /tmp/test_output
------------------------------------------------------------------------

It works great...

Michelle

-- 
Registered Linux-User #280138 with the Linux Counter, http://counter.li.org.