procmail
[Top] [All Lists]

Re: \ marks before punctuation

2002-08-30 02:48:57
I'm building a GUI so my sub-hosts can input their own "exclusion" phrases 
to their personal .procmailrc and need to insert a "slash" before such 
punctuation as . (dot) and @ and I guess single and double quotes

Are you going to allow additions only to condition lines, or more
general recipe editing?  The rules are different in different places.
And for condition lines the rules depend on where in the line you are
and what has gone before.

(And since '@' and quotes don't need escaping in conditions as a rule,
I'm not *entirely* sure I'm understanding you).

However, procmail can do most of the job for you.  If you use variables
as '$\MYVAR' rather than '$MYVAR' then procmail will escape any magic
characters when it expands it.

So you can just set up some CONDITION variables and recipes that use
those, and you only need worry about escaping some single quote marks.
E.g.


  # auto generated condition variables go here
  CONDITION1='here! is? some*+([ junk'

  :0:
  * $ $\CONDITION1
  junk1

and all the magic characters in $CONDITION1 are safely escaped when they
are used.  Some details on $\VAR expansion are in the procmailrc man
page.

Hope that helps,
Martin
-- 
Martin McCarthy                 /</    http://procmail.non-prophet.org
    `Procmail Companion'        \>\
     Addison Wesley             /</                  PGP key available
_______________________________________________
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>