At 03:07 PM 8/20/99 +0200, Vincent Lefevre wrote:
>On Fri, Aug 20, 1999 at 04:40:40 +0300, Mikko Hänninen wrote:
[snip]
>> Maybe a quick hack would be best here, like writing a script that
>> would first remove the Delivered-To header and then remail it
>> manually (eg. "grep -v ^Delivered-To:" piped to qmail-inject with
>
>Well, grep isn't OK, as a Delivered-To: line may also appear in the body,
>and it must not be removed.
When grep isn't quite good enough, consider awk. In this case, you
could filter with, for example:
awk 'x{print;next} /^Delivered-To:/{next} /^$/{x=1} {print}'
If you need to worry about continued header lines (it doesn't seem
likely that Delivered-To: would get that long though), then formail
is probably the way to go.
Cheers,
Stan