So, as LONG as I'm thinking about stuff ...
One weakness of the MH format language is that when it deals with a list
of addresses, there is nothing that really handles a list of addresses.
By that I mean that if you have:
To: Foo Bar <foo@bar.com>, Blah Arg <blah@arg.com>, Some Body <some@body.com>
If you do:
% scan -format '%(addr{to}'
You get:
foo@bar.com
This has always bugged me. Because of my previous message about S/MIME
support, I'd like to think about ways to extract out email addresses in some
kind of form and have the format language deal with them.
So, a thought about that. There was a not-implemented loop syntax in the
MH format code; details here:
https://lists.nongnu.org/archive/html/nmh-workers/2010-12/msg00050.html
That never really got implemented, but it makes me think ... could we
co-op that syntax for something useful?
Let's say it is something like this:
%[%(formataddr{to})%(formataddr({cc})%^%(addr{loop})%#,%]
What does that mean? We take the addresses in the "To" and "cc" headers,
treat them as a address list, and execute %(addr) on each address (the
pseudo-component "loop" will be set to the value of each address as the
loop progresses). Everything after %# gets executed between each entry.
So this on the above To: line would end up generating:
foo@bar.com,blah@arg.com,some@body.com
This might be something I could actually implement in a reasonable amount
of time.
--Ken
--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers