Udi Mottelo <uuddii(_at_)eng(_dot_)tau(_dot_)ac(_dot_)il> writes:
I try to understand the $\VAL and I have difficult while reading
the man pages.
From the procmailrc's man - the BUG part:
"...Furthermore, the result of $\name substitution will never
be split on whitespace..."
I can't understand it and I can't build any demo to research it ?!
I didn't find info in the FAQ also.
It's a rather obscure corner case. To understand it, first think about
when procmail will split a variable on whitespace at all: in action
lines, in '?' conditions, in backquote expansion, and when evaluating
the contents of the TRAP variable right before exiting. Basically:
whenever it's part of a command line or in a mailbox action.
So, the bug is that $\name substitution in such a location isn't being
split, but rather treated as if you had written "$\name".
$ cat foo
SHELL = /bin/sh
VAR = ") foo *?
bar "
:0 iw
|perl -le 'print STDERR join("==", @ARGV)' $VAR $\VAR
$ procmail ./foo </dev/null
)==foo==*?==bar==()\) foo \*\?
bar
$
The $VAR was split on whitespace, so that perl saw the paren, 'foo',
'*?', and 'bar' as separate arguments, while the $\VAR wasn't, despite
the presence of whitespace inside it.
See what I mean by obscure corner case? How often do you really want to
pass a $\var expansion to another command? When doing so, wouldn't you
really want to pass it quoted as a single argument, unsplit on whitespace?
LOG="=== $\MATCH ===
"
LOG="--- $MATCH ---
"
This is a variable assignment, so variables aren't split. Even if they
were, they're in double quotes, so they _can't_ be split.
yarkon~% /bin/echo "Subject: 123 \n qqq" | formail -s procmail ./testrc
...
2> When the "\n" is surrounded by spaces MATCH takes the two lines.
It doesn't matter whether there's whitespace before the newline, but if
there's whitespace after the newline, then you've created a continued
header field and procmail turns the embedded newline into a space before
performing matching.
Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail