procmail
[Top] [All Lists]

Re: stripping lines from the body

2002-11-20 12:19:08

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
|
| What happens is I get this in the log:
|
| procmail: Match on "^List-Id:.*chat-l"
| procmail: Match on "\[.*Webjogger.*\]"
| procmail: Executing " sed -e '/\[.*Webjogger\]/d'"
| procmail: Skipped "$MLDIR/\(Misc\)/Chat-l"
|
| I know I forgot something stupid.

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/...
}


--
If there's a bustle in your hedgerow don't be alarmed now.


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