nmh-workers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nmh-workers] Additional things


From: Ken Hornstein
Subject: [nmh-workers] Additional things
Date: Sat, 28 Sep 2019 22:31:41 -0400

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 <address@hidden>, Blah Arg <address@hidden>, Some Body 
<address@hidden>

If you do:

% scan -format '%(addr{to}'

You get:

address@hidden

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:

address@hidden,address@hidden,address@hidden

This might be something I could actually implement in a reasonable amount
of time.

--Ken



reply via email to

[Prev in Thread] Current Thread [Next in Thread]