Ok, I'll try again. It is very confusing [i've been dealing w/ this for a
long time now]. *All* e.mail goes through this recipe for a list I run
[via smartlist]. So I'm trying to add a [PREFIX] to each subject. But I
always want the [PREFIX] to be the first thing on the Subject: header, ie:
I understood most of that the first time through. I still think your
algorithm must be too unnecessarily complex.
In English, describing a possible algorithm, you can:
a) look for the subject with match and save it;
b) look for the lists you're worried about;
c) if we have a match on the lists, look for either "Re:" or "[PREFIX]"
d) if either is found, use sed to strip them *all* and all extra spacing
sed -e 's/\[Rr][eE]: *//g' \
-e 's/\[PREFIX]//' \
-e "s/[$space$tab]\{2,\}/ /g"
e) if SUBJ had one "Re:" or more in it, put one back now; and
f) prefix "[PREFIX]".
You could combine (e) and (f). If there was a "Re:" that has
since been stripped, add "[PREFIX] Re: ". Otherwise, just
add "[PREFIX] ".
You're done.
--
Dallman Ross <dman(_at_)nomotek(_dot_)com>
U.S. Voicemail/FAX: +1 (415) 276-2873
Residence Telephone: +49 (0) 6122 / 98 04 46
Cellular Telephone: +49 (0) 177 / 515 34 69
Fight Spam! Join CAUCE! == http://www.cauce.org/ or
http://www.euro.cauce.org/
N.B.: For no auto-reply, use <mailto:dman+noacks(_at_)nomotek(_dot_)com>
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail