procmail
[Top] [All Lists]

Re: strange sed bahavior

2002-10-14 14:57:43
At 15:37 2002-10-14 -0500, Bo Peng did say:

>  2. None of your recipes take into consideration that the subject may
>  already contain a list identifier (say, because you posted a reply
>  to
>  a list with this identifier in it, and someone replied to that, and
>  you replied to them - work it out in your head what happens).

lyx-devel does not have a list identifier. That is exactly why I need
one.

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...

>  3. why on earth would you believe you need to run the sed operation
>  "globally" ?

I do not understand your point. I only sed emails from lyx-devel.

'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?

>  5. There are much better ways to do this.  Search for [procmail]
> in the
>  procmail list archives (a searchable archive is linked from the
>  procmail homepage).  It involves using $MATCH and formail.

I do not need a 'better' way if sed can do the job. But I will see what
is $MATCH.

In light of #2, I believe you need a better way. I personally don't see the point in trying to perfect an approach which is seriously flawed (again, see #2), so spending the time to find out why the sed implementation doesn't work seems like a waste, since once you DO get it working, you'll eventually run into issues (or you'll use the nifty thing on another list, where you'll run into the issues) -- better not to become reliant on something that's broken, even if you don't immediatley see that it is so.

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.

I know. Our system administrator has not been updating it for a while.
If this is the souce of the problem, I will install a personal copy of
procmail. (BTW, can procmail be installed without root privilege?)

You can compile it as a user and invoke it via .forward. There sometimes are issues, but either you have procmail as LDA, in which case it should pay attention to .forwards, or if it isn't the LDA, you're already invoking it via .forward, just from a system dir.

The chief two issues you might have with invoking a personal copy are whether the mail server is the same system which your homedir is on (a problem I've never had myself, so I can't really elaborate on it much), and if you have smrsh (Sendmail Restricted Shell), which can limit what you can run from your .forward (not an issue if your system is using procmail as LDA).

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

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