Hal Wine <hal(_at_)dtor(_dot_)com> wrote:
At 08:15 10/12/95, Professional Software Engineering wrote:
* if not, does anyone have any interest in the (simple) line
remover utility (as C source -- all like 7 lines of it)? I
don't do perl, and I know it could be done a dozen or more
different ways (all of them valid).
It struck me that if you remove the separator line, that you
can simply 'cat' additional header lines into the stream,
which is a LOT easier than having to give formail lots of
options.
Well, formail wouldn't have been called formail, if it wouldn't allow
you to do most anything for mail :-). It can already do what you want,
without lots of options...
:0 hf
* whatever
| $FORMAIL -rt | cat - $HOME/newHeaders
This sends only the headers ('h' option) to first formail to play with
them. Formail's output is the sent to cat, which replicates them, followed
by the new headers. The result is used to replace the original headers
('f' option)
The problem here is that there will be a newline in the middle, which
causes the header to be shortened (procmail determines the new header/body
boundary after having processed each filter).
Try this instead:
:0 hf
* whatever
| $FORMAIL -rt -X "" ; cat $HOME/newHeaders
--
Sincerely,
srb(_at_)cuci(_dot_)nl
Stephen R. van den Berg (AKA BuGless).
"And now for something *completely* different!"