nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] replcomps - %friendly() with table lookup?

2012-09-02 10:12:48
Is there a way to have friendly() [or some other function] doing some
table / database lookup to come up with such an even more friendly()
greeting?

Sure; just write the code! :-)

I was going to suggest some options involving the functions profile()
or getenv(), but I see they only take literals; there's no way to
build up a string and then look it up in the profile or environment
(otherwise you could do something like %(profile(addr{from})) ).
So, I'm kinda stumped as to how you could do this with stock nmh.

Ah, wait, ONE option comes to mind.  Are you using replyfilter?  If
so, you could add an extra option (or two) to your replyfilter
arguments in mhl.reply, and have replyfilter look up the "friendly"
name however you wish and write out the "Dear xxx" line for you.
If you're not using replyfilter ... well, why not? :-)

If you don't wish to do that ... you'd have to write a new format function.
That's not as bad as it sounds; I've put a lot of documentation in the
source code for those things.  Take a look at sbr/fmt_compile.c and
sbr/fmt_scan.c.

--Ken

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

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