procmail
[Top] [All Lists]

Re: SUMMARY: Echo replier: sending back headers and body

1996-03-21 14:55:48
Stephane Bortzmeyer wrote,

|         HEADERS=`formail -X ""`
|         BODY=`formail -I "" | sed 's/^/> /' `

If your formail is new enough to understand partial header names, then your
procmail must be new enough to handle variable capture, so you can do these
with less overhead, since they feed only the relevant portion:

  :0h
  HEADERS=|cat

  :0b
  BODY=|sed 's/^/>/' # or BODY=`sed 's/./>&/'` not to cite blank lines

But if you have to use the `...` syntax, you can extract the body and add
citation characters with only one process instead of using both formail and
sed:

  BODY=`formail -rkI ""` # inserts > on non-blank lines
or
  BODY=`sed -e 1,/^$/d -e 's/./>&/'` # likewise adds > on non-blank lines
or
  BODY=`sed -e 1,/^$/d -e 's/^/>/'` # inserts > on all lines

<Prev in Thread] Current Thread [Next in Thread>