procmail
[Top] [All Lists]

Re: Trouble with $SPACETAB

1997-10-29 10:57:30
When I suggested this to Jari Aalto,

| > You can still do it with a real horizontal tab character.  If that doesn't
| > satisfy you, you can set a variable that contains a tab (or a space and a
| > tab) and use it with "$" interpretation:
| > 
| > SPACETAB="      "
| > 
| > and then write things like
| > 
| >         * $ ^Header-Name:[$SPACETAB]*\/[^$SPACETAB].*

Ed James responded,

| I tried this in my .procmailrc and did not get the selection I wanted.
| Attached is the script output from a test setup I created and ran on
| HPUX B.10.10 on a 9000/770.
| 
| Can anyone please tell me what I am doing wrong?

Yes, Ed.  Consider the conditions you used it in:

  * ^Sender:[$SPACETAB]+hpux-admin-owner(_at_)cv(_dot_)ruu(_dot_)nl
  * ^Sender:[$SPACETAB]*hpux-admin-owner(_at_)cv(_dot_)ruu(_dot_)nl

You forgot the "$" modifier at the beginning of the condition.  Without
it, [$SPACETAB] means "a dollar sign, an S, a P, an A, a C, an E, a T,
(redundantly) an A, or a B".  (A $ inside brackets matches a literal dollar
sign.)

Add the $ modifier to tell procmail to do variable and command substitution
before evaluating the regexp:

  * $ ^Sender:[$SPACETAB]+hpux-admin-owner(_at_)cv(_dot_)ruu(_dot_)nl
  * $ ^Sender:[$SPACETAB]*hpux-admin-owner(_at_)cv(_dot_)ruu(_dot_)nl

While we're at it, it is a good idea to escape the periods:

  * $ ^Sender:[$SPACETAB]+hpux-admin-owner(_at_)cv\(_dot_)ruu\(_dot_)nl
  * $ ^Sender:[$SPACETAB]*hpux-admin-owner(_at_)cv\(_dot_)ruu\(_dot_)nl

<Prev in Thread] Current Thread [Next in Thread>