procmail
[Top] [All Lists]

Re: for John Hardin's wish list

1998-08-25 00:02:42
Walter Dnes wrote,

|   This is probably #7, since others have been inserted...
|   I would *LOVE* to see a VARIABLE (HEADERCOUNT) and a
| STRING ARRAY (HEADERLINE[N]) returned, where...
|   HEADERCOUNT = the number of header lines (after folding)
|   HEADERLINE[N] = the Nth header of the message

HEADERCOUNT is easy enough to get now when you need it:

 :0H # note trailing period in condition line
 * 1^1 ^.
 { HEADERCOUNT = $= }

Remember that newlines for continuation lines of a headerfield do not
match ^ nor $, so the folding is already done.

That is, unless I misunderstood Walter's meaning of "after folding" and
he wants continuation lines counted separately.

As to the Nth header, that will be easier if Stephen or someone ever
implements magic braces for counting.  The seventh header field will
then be extractible this way:

 * H ?? ^^(,+)$\{6\}\/.+

it there still would be no support for array variables.