On Wed, 14 Mar 2001, Dallman Ross wrote:
} > :0 # is the subject tagged already? If not, capture it
} > * ! ^Subject:.*\[PREFIX\].*
}
} Hi, Vince. Why would the subject be tagged already, I'm wondering, to
} start? You ought to set up one and only one place in your rc that
} handles this prefixing that you want of subject. But that's a minor
} point.
The included recipe does it all - it adds the [PREFIX] if it's not there,
and gets rid of the leading Re: before the [PREFIX] if there is one. This
recipe is used in my rc.local.s20 rc file, though that's not all that
important.
} > { # strip off any leading "Re: " strings
} > CURSUB=`echo $MATCH | sed -e 's/^ *R[Ee]: *//g'`
}
} The above line is a problem. You are telling sed to find multiple
[snip]
} Try just (untested, of course):
}
} CURSUB=`echo "$MATCH" | sed 's/R[Ee]: *//g'`
Same results, unfortunately. It's due to the fact that the first time the
[PREFIX] has been detected *without* a "Re: " *after* the [PREFIX], an
extra space is generated. [more explained below]
} > :0 fhw
} > | formail -I"Subject: [PREFIX] $CURSUB"
} > }
} > :0 Efhw # see if it is a tagged reply; if so, move the "Re:"
} > * ^Subject: *(Re: *)+\[PREFIX\] *\/.*$
} > | formail -I"Subject: [PREFIX] Re: `echo \"$MATCH\" | sed -e 's/^ *R[Ee]:
*//g'`"
}
} My second cup of coffee has not helped me wake up enough to allow me to
} have had light shed on what you're doing here exactly. I see in general
} terms, but don't follow your heuristic that requires munging the subject
} both in the main recipe and in the "Else" (E-flag) recipe. Maybe a
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:
Subject: [PREFIX] Re: nice list
And the above recipe does do this, except for when someone replies to the
first post in a thread. The replies to the reply look fine:
Subject: [PREFIX] nice list
Subject: [PREFIX] Re: nice list
Subject: [PREFIX] Re: nice list
Subject: [PREFIX] Re: nice list
So the original subjects, before hitting my recipe, look like this:
Subject: nice list
Subject: Re: [PREFIX] nice list
Subject: Re: [PREFIX] Re: nice list
Subject: Re: [PREFIX] Re: nice list
[at least this is how my MUA shows them, but the above examples of how
they look after being processed is true for all members of the lists].
Hope that makes more sense. :)
TIA,
/vjl/
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail