procmail
[Top] [All Lists]

Re: Rule does not work after update

2005-02-23 05:22:38
Toen wij Stefan Heinrichsen kietelden, kwam er dit uit:

theo following rule
does not work anymore.

 :0 fwh
 * ^Subject:\/.*(\[(JI|KL|FLT|SMS)\]).*$
 {
   NEWSUBJECT = \
     "`/bin/echo $MATCH | \
       /usr/bin/awk \
       '{gsub(/(\[(JI|KL|FLT|SMS)\] )/, \"\"); print; }'`"
   |/usr/bin/formail -i "Subject: $NEWSUBJECT"
 }


1. Their should at least be a :0-line before the formail-line.
2. The Subject-condition ends in '$', no need for that.
3. You are matchng Subject from the start, yet introducing a 
   space in the formail-call.
4. You could replace awk by sed, or by a "just-procmail" Find&Replace.

  regex = '\[(JI|KL|FLT|SMS)\]'
  :0 fwh
  * ^Subject:.*$regex
  |/usr/bin/sed "s/^\(Subject:.*\)$regex/\1, \"\"/"

(untested)

-- 
Grtz, Ruud

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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