Procmail recipe: extracting matched text

Nemo - earth native nemo at nut.house.cx
Tue Dec 10 11:52:39 EST 2002


On Tue, Dec 10, 2002 at 11:33:50AM +1100, Michael Still did utter:
> now that we're talking about regexps, I am having some troubles finding
> documentation which covers the text matching in procmail.
> 
> Specifically, I have a rule like:
> 
> :0:
> * List-Id.*<([^.]*).*>
> $1
> 
> Which should match any mailman mailling list, and then put the mail into a
> folder named after the first portion of the list id.

THe following is my procmail filter, which catches all my list mail,
including mailman - though don't ask me which particular one is actually
active in capturing mailman lists... ;)


:0:
* ^Sender: owner-\/[^@]+
lists/$MATCH

:0:
* ^Sender: \/[^@]+-owner
lists/$MATCH

:0:
* ^X-BeenThere: \/[^@]+
lists/$MATCH

:0:
* ^Delivered-To: mailing list \/[^@]+
lists/$MATCH

:0:
* ^X-Mailing-List: <\/[^@]+
lists/$MATCH

:0:
* ^X-Loop: \/[^@]+
lists/$MATCH



.../Nemo  (no, I didn't write the above)
-- 
  Why, do you think I ought to have /\/         <nemo at nut.house.cx>
 one? It seems odd to give a bundle \                    ...               
of vague sensory perceptions a name /  DISCLAIMER:  Use of advanced messaging 
                ...                 \ technology does not imply an endorsement
   http://www.nut.house.cx/~nemo  /\/    of western industrial civilization   



More information about the linux mailing list