I didn't know that you could filter on the body
How is that done?
On 2003.04.23 14:21 Kim Scarborough wrote:
I get a lot of automated announcements that contain a lot of stuff that
doesn't concern me, so I wrote this recipe to only let them through if they
contain "foo" or "bar" in the body:
:0:
* ^From:(_dot_)*root(_at_)(_dot_)*\(_dot_)domain(_dot_)com
* ^Subject:.*Swatch\ Report.*
{
:0 B
* !(foo|bar)
$TRASH
}
$MAIL
That works fine and eliminates a lot of mail I don't need. However, the
individual messages have a lot of text, so I'd like to trim down the messages
I do get by grepping for foo|bar in the body of the message and having only
that display in the body. The problem is that just piping it through grep
will
remove my headers, too, which I obviously don't want. I thought maybe I could
use formail to grab the headers, then run the message through grep, and
re-prepend the captured headers to the truncated body, but that seems
difficult and unwieldy (and perhaps impossible). So I wanted to check here
first to see if there were better solutions.
--
----------------------------------------------------------------------------
Kim Scarborough http://www.unknown.nu/kim/
----------------------------------------------------------------------------
"Trying is the first step towards failure."
- Homer Simpson
----------------------------------------------------------------------------
Now listening to: Charlie Christian - "Wholly Cats [No. 2]"
----------------------------------------------------------------------------
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail
--
__________________________
Brooklyn Linux Solutions
__________________________
DRM is THEFT - We are the STAKEHOLDERS http://fairuse.nylxs.com
http://www.mrbrklyn.com - Consulting
http://www.inns.net <-- Happy Clients
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive or stories and
articles from around the net
http://www2.mrbrklyn.com/downtown.html - See the New Downtown Brooklyn....
1-718-382-0585
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail