procmail
[Top] [All Lists]

Re: Truncating STILL not working

1996-05-29 19:58:16
P1B

On Wed, 29 May 1996, David W. Tamkin wrote:

Gino Filicetti asked,

| Ok Guy, I followed your suggestions, and narrowed the problem down to this
| line....
|
|    :0
|    * NAME ?? .
|    * NAME ?? ^\/.{1,25}  <<<<<<<<<<<<<<<<<<<<<<<<---------------
|    { NAME = $MATCH }
|    :0E
|    { NAME = "$FROM_ADDRESS" }

I'm sure procmail doesn't see braces as magic in regexps and is looking for
a match to the literal text there (except the period).  Try this instead:

     * NAME ?? ^^\/...........................

with twenty-five dots.  If $NAME is shorter than twenty-five characters,
the condition will fail and the :E section will replace the current value
of $NAME with a copy of $FROM_ADDRESS.  If $NAME is twenty-five characters
or longer, it will be truncated to the first twenty-five.

Actually, I get a feeling that the logic is wrong; are you sure you want
NAME to be changed to equal $FROM_ADDRESS if it's between one and twenty-
four characters long?  Don't you want that only when it's empty?  And if
$FROM_ADDRESS is over twenty-five characters, don't you still want $NAME
truncated to twenty-five?

    :0 # if $NAME is null or unset, get a value from $FROM_ADDRESS
    * ! NAME ?? .
    { NAME = "$FROM_ADDRESS" }

    :0 # if $NAME has more than twenty-five characters, truncate
    * NAME ?? ^^\/.........................
    { NAME = "$MATCH" }


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