Excerpts from [procmail]: (20-Oct-97) Re: line-by-line processing (was:
Filtering out unwanted mime attachments) by Philip Guenther
Procmail explicitly strip a leading newline from whatever is matched.
I've sent the above patch off to Stephen, along with a request that
the "strip one leading newline from $MATCH" behaviour be documented,
or fixed to only apply to ^ and not $.
Thanks for the patch, Philip! In my testing this morning, I came across the
same bug and was rather perplexed by it. I hadn't yet arrived at the point
where I understood what was going on though.
I must say that I really do not like this "feature", either documented or
undocumented. If the regexp engine can be modified to only strip leading
newlines from MATCHed regexps starting with "^", I would find that acceptable
(if inconsistent). But if that's too complicated and it's a choice between
always stripping a leading newline from MATCH and not stripping at all under
any circumstances, then I vote strongly for not stripping at all.