procmail
[Top] [All Lists]

Re:'s and Fwd's

2001-06-17 22:43:55
Heya all,
  Been watching all day, didn't see this appear on the list, so I'm
reposting, so please forgive me if it did and I missed it :)
  Anyway, I'm trying to come up with a recipe that will deal with all the
re's and fwd's that appear in the subject line

    Subject: Re: Re: Fwd: re: identd

a previous post a while back gave me the idea and this is what I've got so
far

    :0
    * ^Subject: (Re|Fw|Fwd):.* \/.*
    {
       CURSUBJECT="$MATCH"
       CURSUBJECT=`echo $CURSUBJECT | sed s/.R\[Ee\]://g`
       CURSUBJECT=`echo $CURSUBJECT | sed s/.F\[Ww\]://g`
       CURSUBJECT=`echo $CURSUBJECT | sed s/.F\[Ww\]\[Dd\]://g`

       :0f
       | formail -I"Subject_New: $CURSUBJECT"
    }

but I'm wondering if there's a way to have it leave what ever the last
mail operation was, the one directly after the subject, so that it would
say

    Subject: Re: identd
         or
    Subject: Fwd: identd

depending on whatever the last mail operation was. I know I can force it
by making the overall recipe longer with multiples of these

    :0f
    * ^Subject: Re:.*
    {
       CURSUBJECT=`formail -xSubject: | sed s/.R\[Ee\]://g`
       :0fh
       | formail -i"Subject: Re: $CURSUBJECT"
    }

one for each type of message, Re: Fwd: Fw:

-- 
      S.Toms - smotrs(_at_)mindspring(_dot_)com - www.mindspring.com/~smotrs
                   SuSE Linux v7.0+ - Kernel 2.2.18

        WARNING TO ALL PERSONNEL:

Firings will continue until morale improves.




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

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