procmail
[Top] [All Lists]

Re: strange sed bahavior

2002-10-14 19:03:02
On Mon, Oct 14, 2002 at 02:39:54PM -0700, Professional Software Engineering 
wrote:
At 15:37 2002-10-14 -0500, Bo Peng did say:

Re-read item #2.

   You receive:  "Subject: whatever"
   You rewrite that to: "Subject: [tag] whatever"
   You reply to one of these: "Subject: Re: [tag] whatever"
   You receive YOUR post from the list: "Subject: Re: [tag] whatever"
      (as does everyone else)
   and YOU rewrite that as: "Subject: [tag] Re: [tag] whatever"
   Someone else replies to your post: "Subject: Re: [tag] whatever"
   You receive that, and rewrite it: "Subject: [tag] Re: [tag] 
   whatever"
   You reply to that: "Subject: Re: [tag] Re: [tag] whatever"
   And when you get that back from the list and rewrite it, you now 
   have
      THREE [tags] on it...

I understood this scenario from your first reply. As I had said, I will 
not reply the tagged emails.

'g' flag at end of the sed operation - why do you feel you need to use that 
if there's only ONE SUBJECT PER MESSAGE?

My fault. There should be no g. I am not very careful about such things. As 
long as it works...

There exists an approach which does what you want already, using $MATCH, 
and addresses the issues I raise in #2.  A basic form is:

# set the list identifier
list=lyx-devel

# this makes sure that the subject doesn't ALREADY CONTAIN the tag
# then grabs the original subject and inserts the identifier.
:0 fhw
* $ ! ^Subject:.*\[$list]
* ^Subject:\/.*
| formail -I "Subject: [$list]$MATCH"

It should be noted that *I* don't use this - I don't muck with list 
subjects, so there are no doubt other users here capable of putting 
forth a more refined version of the above.

This works fine. Thanks.

-- 
Bo Peng
_______________________________________________
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>