procmail
[Top] [All Lists]

Re: Echo replier: sending back headers and body

1996-03-20 13:15:44
Stephane Bortzmeyer replied to Doug Hughes's advice:

| The big problem is that I want ALL the headers even funny custom things
| like X-Zippy. I don't want to enumerate all possible headers.

No problem.  Here are several ways to get the entire header into a variable:

 HEADER=`formail -X ""` # The space after the X is vital.

or

 HEADER=`sed /^$/q` # also writable as   HEADER=`sed /./!q`

or

 :0h
 HEADER=|cat

will save the entire header into one variable.  It has to be smaller than
$BUFSIZE, though.  This way might work as well, and will require no outside
processes if it does:

 :0 # `H' flag is implicit
 * ^^\/(.+$)*$
 { HEADER=$MATCH }