Solved: [CLUE-Tech] using procmail to send a message to a script?
Dave Price
davep at kinaole.org
Mon Oct 21 09:38:49 MDT 2002
On Mon, Oct 21, 2002 at 08:08:21AM -0600, Dale Hawkins wrote:
> Dave Price <davep at kinaole.org> writes:
>
> > I have a procmail recipe that can identify a specific message and move
> > it to a folder, but I would like to send it thru a perl script before
> > sending it to the folder.
Here is what i got working (trivial examples to test methods):
:0fbw
* ^Subject.*EMAZING Virgo
| /home/davep/filter_virgo.pl
#:0:
#* ^Subject.*EMAZING Virgo
#virgo
The 1st rule pipes the body (b) of the message to a filter (f) and waits
(w) until the filter completes before further processing,
2nd rule matches the (unchanged) header and stuffs filtered message into
a folder.
The filter script just grabs the content of interest and drops all the
html and advert crud.
Another example:
:0:
* ^Subject.*FareShare.Gazette*
| /home/davep/strip_fareshare.pl
:0:
* ^Subject.*fsg:*
recipes
This one pipes the whole message to a script. The script pulls
the content (possibly more than 1 recipe) out of the message, and
_remails_ it to me with the recipe title prepended with 'fsg:' as
the new subject; the 2nd rule matches this message and files it.
Thanks for the input!
I did find a nice linuxmag article on this:
http://www.linux-mag.com/2001-07/guru_01.html
aloha,
dave
More information about the clue-tech
mailing list