procmail
[Top] [All Lists]

Re: interesting [prefix] problem (fwd)

1999-10-22 14:10:10
Hi folks,

Though this is/was smartlist related, it is a procmail recipe that I'm
having problems with and I've not been able to solve it. Below is a
follow-up to Philip's reply. My original post [which might not be needed
to understand the problem] can be found at:

http://www.cnr.berkeley.edu/~casterln/smartlist-arc/msg02764.html

Any ideas would be greatly appreciated.

/vjl/

-- 
Vince J. LaMonica    // T e a m    // Photographer: aviation, sports,
vjl(_at_)cullasaja(_dot_)com \XX/ A M I G A  // nature, art, travel, documentary

       This e.mail was composed on Oct 22, 1999 at 1:59pm PDT.

---------- Forwarded message ----------
Date: Fri, 15 Oct 1999 22:31:35 -0700 (PDT)
From: Vince LaMonica <vjl(_at_)cullasaja(_dot_)com>
To: Philip Guenther <guenther(_at_)gac(_dot_)edu>
Cc: Smartlist List <smartlist(_at_)informatik(_dot_)rwth-aachen(_dot_)de>
Subject: Re: interesting [prefix] problem 
Resent-From: SmartList(_at_)informatik(_dot_)rwth-aachen(_dot_)de
Resent-Date: Sat, 16 Oct 1999 07:32:11 +0200 (MET DST)
Resent-From: SmartList(_at_)informatik(_dot_)rwth-aachen(_dot_)de

On Wed, 13 Oct 1999, Philip Guenther wrote:

} Also note that be putting the '$' at the end of the regexp, you cause
} the newline to be included in MATCH.  You probably don't want that, and
} procmail doesn't need the anchoring to know to slurp up to the newline,
} so I would suggest leaving it off.  Also, you may want to skip over both
} spaces and tabs:

[snip recipe]

Ok, I've tried a modified version of your recipes [with the changes being
in the sed statement], and now all follow-ups have a Subject: of just
[PREFIX] Re: 

[though the first post to the list does show '[PREFIX] Testing' as the
subject].

The recipe I'm using is below:

########################

        # Clear the CURSUB variable.  We'll set it if we need to rewrite
        # the Subject: header
        CURSUB

        :0      # is the subject tagged already?  If not, capture it
        * ! ^Subject:.*\[The\ Box\].*
        {
            :0    # space/tab in below brackets
            * ^Subject:[        ]*\/[^  ].*
            {   # strip off any leading "Re: " strings (ignoring case)
                CURSUB = `echo "$MATCH" | sed -e 's/^[Rr][Ee]: *//g'`
            }
            :0 E
            {   # No Subject: header or it only contained whitespace
                CURSUB = "(no subject)"
            }
        }

        :0 E    # see if it is a tagged reply; if so, move the "Re:"
        * ^Subject: *(Re: *)+\[The\ Box\]\/.*
        {
            :0    # space/tab in below brackets
            * MATCH ?? ^^[      ]*\/[^  ].*
            {
                CURSUB = "Re: "`echo "$MATCH" | sed -e 's/^[Rr][Ee]: *//g'`
            }
            :0 E
            {   # This really shouldn't be happening, but just in case...
                CURSUB = "Re: (no subject)"
            }
        }

        # If CURSUB was set, use it as the new post-tag subject
        :0 fhw  # what does the second 'bang' (!) mean??
        * ! $ ${CURSUB+!}
        | formail -I"Subject: [The Box] $CURSUB"

##############################

Note my question in the last comment; what does the bang do in
the var ${CURSUB+!} ?

Anyway, the goal of the above recipe is to produce subjects that begin
with:  [PREFIX] Subject       and
       [PREFIX] Re: Subject

My current solution [posted a couple days ago] puts an extra space after
any followup that has a subject with no Re: in it [the extra space appears
after the 'Re:'

What am I missing in the above recipe?

TIA,

/vjl/


<Prev in Thread] Current Thread [Next in Thread>
  • Re: interesting [prefix] problem (fwd), Vince LaMonica <=