procmail
[Top] [All Lists]

Re: Nested recipes... (sorry if this is sent twice.. )

2005-01-23 18:04:16
On Sun, Jan 23, 2005 at 06:36:01PM -0500, Glenn Sieb wrote:
Glenn Sieb said the following on 1/23/2005 4:26 PM:

Dallman Ross said the following on 1/23/2005 6:53 AM:

 :0
 * ^TO_root(_at_)\/(Wingfoot|Databasement)[.]org\>
 * MATCH ?? ^^\/[^.]+
 {
     LOG = "$NL$MATCH Root Mail$NL"

     :0
     .$MATCH.Root/
 }

Ok--I put this in.. Love it.. except for one thing.. $MATCH is always 
wingfoot or databasement, where the folders they were in were originally 
Wingfoot and Databasement ... is there a way to manipulate $MATCH so I 
can turn it into always being initial-caps? (I see lots of things were 
people seem to prefer lowercase, however, I'm not one of them... :-/ ). 
What would be the best way of doing this? sed (err gsed in my case 

No!!!!!!!!!!!!!  We don't need an external program for this.

I'll use the FreeBSD list parser that I worked up in the subsequent post
and continue the example:



  HOSTCLASS  = '[a-zA-Z0-9-]+'
  MYBSDLISTS = '(Advocacy|announce|chat|config|doc|hackers|jobs|newbies|\
                 Performance|POrts|questions|stable|testing|user-groups|www)'


  :0
  * $ ^List-Post:(.*\<)?\/$MYBSDLISTS@($HOSTCLASS[.])*freebsd[.]org\>
  * MATCH ?? ^^\/[^(_at_)]+
  {
      MYSTRING = $MATCH

      :0
      *   MYSTRING ?? .\/.*
      { _YSTRING = $MATCH }

      cAsE = 'aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ'
      :0
      *   MYSTRING ?? ^^\/.
      * $ cAsE     ?? $MATCH\/.
      { MYSTRING = ${MATCH}${_YSTRING} }
      
      LOG = "$NL$MYSTRING FreeBSD List$NL"

      :0
      .$MYSTRING/
  }


Ruud van Tol has, I believe, a more generic case-switcher on his site.
I can't quite find it right now.  But here's the top of his site:
http://www.xs4all.nl/~rvtol/procmail/

Btw, I did not proofread the value of $cAsE very carefully.  It's
possible I have a typo in there.  Don't just copy-and-paste it blind
without checking.

-- 
dman

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail