procmail
[Top] [All Lists]

Re: Appending text to subject line

2000-02-13 09:45:09
Speaking as one totally ignorant in Formail, in the following recipe how
does Formail determine which part is being set aside as the $MATCH?

* ^Subject:.*\[SLE\] \/.*

Glen

On Sat, 12 Feb 2000, S.Toms wrote:

On Sat, 12 Feb 2000, Jeff Grossman wrote:

jg> Would somebody be willing to give me an example recipe to make this work?
jg> 
jg> Thanks,
jg> Jeff
jg> Jeff Grossman (jeff(_at_)stikman(_dot_)com)
jg> 
jg> 

 I use the following to remove part of the subject of certain messages
with pretty good success.

   :0f
   * ^Subject:.*\[SLE\] \/.*
   | formail -bfi "Subject: $MATCH"


 It wouldn't be to hard to add text anywhere within that line just add it
before or after the $MATCH, before would be what your desiring. So, to
make it do what your looking for try the following.

   :0f
   * ^Subject: \/.*
   | formail -bfi "Subject: blah $MATCH"

just replace 'blah' with what you would like added to the subject and
add the following rule after it to forward.

   :0ac
   ! address(_at_)somewhere(_dot_)com

 Which basically means that as long as the subject rule processed and
finished correctly, then a copy will be forwarded, otherwise it gets
processed by the rest of your rules.

jg> 
jg> > Jeff Grossman writes:
jg> > > Would I be able to do the same thing, but put some text in the 
beginning
jg> of
jg> > > the Subject line instead of the end with the example you stated?  I was
jg> goin
jg> > > g to use Formail.  Would Perl work better in this situation, or 
Formail?
jg> >
jg> >  You don't need either. Just capture the Subject: in MATCH.
jg> >  It's too late and I'm too tired now to write down a recipe for that :)
jg> >
jg> >
jg> 
jg>