procmail
[Top] [All Lists]

Re: Why does this rule work?

1999-06-10 05:34:14
Holger Wahlen:
 |Randall Hopper mentioned a recipe to remove list tags from 
 |subject lines:
 |
 |>   :0
 |>   * ^Subject:[ ]+\/.*
 |>   {
 |>     subj = `echo "$MATCH" | sed -e 's/\[opendx-general\] //g'`
 |> 
 |>     :0 fwh
 |>     | formail -I "Subject: $subj"
 |>   }
 |
 |Do you really need all that? I'd just use
 |
 |      :0 fwh
 |      | sed '/^Subject:/s/\[opendx-general] //'

Thanks.  This is certainly much cleaner.  Acknowledging your notes on ways
it could break, I'll prefer your form.  Some of the disadvantages you
mention aren't an issue for me since this subject munging is always done by
the list server, and I'm already in a block that knows we're dealing with
this particular list.

(For the archives,) my revised, simpler rule is now:

     :0 E
     * ^Sender: owner-opendx-general
     {
       :0 fwh
       | sed -e '/^Subject:/s/\[opendx-general\] //g'

       :0:
       dx.ml.new
     }

versus:

     :0 E
     * ^Sender: owner-opendx-general
     {
       :0
       * ^Subject:[ ]+\/.*
       {
         subj = `echo "$MATCH" | sed -e 's/\[opendx-general\] //g'`
       
         :0 fwh
         | formail -I "Subject: $subj"
       }

       :0:
       dx.ml.new
     }

Thanks,

Randall

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