procmail
[Top] [All Lists]

Re: Replacing characters in $MATCH, and folders with periods - SOLVED

2004-04-09 17:11:11
Toen wij Timur Tabi kietelden, kwam er dit uit:

Ok, I finally got it working.  Thanks to everyone for their help.
First off, I had to download four files and put them in my
~/Maildir/inc directory: 

Or, I suppose, in any other convenient directory. 
I use $HOME/pm for my active rcs, the incs could 
live in $HOME/pm/inc then.

rep.inc  rep.inc.inc  snr_fast.inc  snr_fast.inc.inc

Yes, I forgot to mention the rep-stuff. 

The 'mother' of snr (search'n'replace) is bq (decoding of base64 
and quoted-printable). rep is so basic that it doesn't have a 
rep_demo.rc yet, but it deserves one since it is useful even 
without any of the other stuff. 

Because the modules use each other where feasible, it's easiest 
to wget the whole thing to your $HOME/pm.


And here's the recipe I'm using:

:0
* ^TO_ \/(_dot_)*(_at_)subdomain\(_dot_)domain\(_dot_)com

Do you really want that space there? I guess this is 'safer':

   * ^TO_\/[^ ]*(_at_)subdomain\(_dot_)domain\(_dot_)com


* MATCH ?? ()\/[^(_at_)]+
{
   snr_String  = $MATCH
   snr_Search  = "."
   snr_Replace = "-"
   INCLUDERC = inc/snr_fast.inc
   :0
   .$snr_Return/
}

I think this belongs in some kind of FAQ.

You are right. It is not meant for the faint at heart. 
The *_demo.rc's show what you can do with each technique. 

In http://www.xs4all.nl/~rvtol/procmail/ bq_!readme.txt 
you will find an email-address for questions.

Currently I am working on a demime in 'just procmail'. 
I already have a prototype, but that needs sed (only 
once though).

-- 
Grtz, Ruud

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