procmail
[Top] [All Lists]

Re: help with maximum message size rules

1999-06-24 06:28:23
John Coy elaborated,

| I should have included my recipe portion which
| attempted to get the headers:

|     :0 h
|     HEADERS=| echo

Since echo does not read stdin, you'd get an empty variable (and, if the
head is long enough to need to start a second buffer, a write error).  As
Era has said, to get the entire head into a variable,

      :0h
      HEADERS=| cat

or if it fits into LINEBUF, save a process:

      :0H # yeah, H is default, but let's make it clear what we're doing
      * ^^\/(.+$)+$
      { HEADERS=$MATCH }

|        echo ${HEADERS}

And that was the problem: when echo echoes unquoted variables, every run of
whitespace is converted to a single space.   You could have preserved the
newlines and tabs with

        echo "$HEADERS"

or, John, since you prefer to brace your variables,

        echo "${HEADERS}"