procmail
[Top] [All Lists]

Re: question/query from procmail newbie

2001-09-04 12:08:17
Michael Geier, CDM Systems Admin <mgeier(_at_)cdmsports(_dot_)com> wrote:
Trying to find/write a recipe where I take the From: out of an email based
on Subject:, write it to a file, and dump the mail.

I realize I need file locking, and I have seen some interesting examples
over the past few days, but I never seem to get it quite right.

Critiques/help appreciated greatly.

:0i:
* ^Subject:.*expression1.*
* ^Subject:.*expression2.*
| formail -rzxTo: >> $HOME/storage

This recipe will match if _both_ expression1 and expression2 are in
the subject.  Is this what you want?
If you want to write the From: header to a file, the following might
be a start:
:0:$HOME/storage.$LOCKTEXT
* ^Subject: $expression
* ^From:[   ]*\/.* #literal space and tab in [ ], and yes I know you
                  #shoulnd't put comments here.
| cat $MATCH >> $HOME/storage

I'm sure someone else will come up witha way of doing it without a
cat call, but I can't :-)

--
Lawrence Mitchell
wence(_at_)newald(_dot_)homeip(_dot_)net
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>