nmh-workers
[Top] [All Lists]

Re: format and output all received: lines in an e-mail message

2019-11-20 07:36:16
then, i'd like to use something like fmttest(1) to print out all the
"Received:" lines in an e-mail message.  ideally, each "Received:" line
would come out on a separate line; less ideally, but i'm sure very
practical, a very long line would come out, with some odd ascii code
separating the individual lines.

The format engine may not be the best tool for this job.

It is really optimized for dealing with header fields that appear only
once (e.g., Subject) or ones that can be combined in a reasonable
way (like header fields that contain address).  So when you refer to
%{received}, you're getting everything folded together.  There's no loop
processing that you could use to say, "Run these commands for every
instance of the Received header", which is really wnat you want.  That's
not to say it wouldn't be useful, but it would require some serious
rethinking of the format engine.

But, have you considered using mhl with a custom mhl format file?  That's
a tool designed to deal with each invidiual header, and I think that
would do exactly what you want.

--Ken

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