procmail
[Top] [All Lists]

Re: stripping lines from the body

2002-11-20 13:05:53
On 20 Nov, LuKreme wrote:
| 
| On Wed, 20-Nov-2002, at 09:45:54 -0700, Don Hammond wrote:
| 
| > On 19 Nov, LuKreme wrote:
| > | recipe:
| > | :0
| > | * ^List-Id:.*chat-l
| > | {
| > |     :0bf
| > |     # If the mailboddy contains [text Webjogger text] strip that line
| > |     * \[.*Webjogger.*\]
| > |     | sed -e '/\[.*Webjogger\]/d'
| > | }
| > | $MLDIR/\(Misc\)/Chat-l
| > |
|
| [...]
| >
| > Yeah, you forgot to start the recipe with ":0".  It skipped the action
| > line because it's not really an action line since it's not part of a
| > valid recipe.
| 
| Hrm... the {} are the action for the first :0.  That seems to always 
| cause me troubles.
| 
| >   :0
| >   $MLDIR/\(Misc\)/Chat-l
| >
| > I would think you want that inside the braces too (or add an "A" flag 
| > to
| > it).  Otherwise every message that gets to that point in your rcfile
| > will be deposited in that folder, whether it matches List-Id:.*chat-l
| > or not.
| 
| so:
| 
| :o
| ^ List-ID:....
|   {
|      :0bf
|       ...
| 
|       :0
|       $MLDIR/...
| }
| 

Yes, either that or:

  :0
  * ^List-ID:....
  {
     :0bf
     ...
  }

  :0A:
  $MLDIR/...

Functionally they're the same, so it's a matter of taste I guess. Don't
forget the trailing colon to lock the file either way.

As for the {} braces being "the action line for the first :0", I've
never thought of it that way.  But if you were expecting the first :0
to pair off with that dangling delivery, then I suppose that would be
one way to look at it.  The procmailrc man page seems pretty lucid on
braces.  Bring up the man page and search for "{" (i.e. /{ <enter> ).

-- 
Reply to list please, or append "8" to "procmail" in address if you must.
Spammers' unrelenting address harvesting forces me to this...reluctantly.



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail