nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] Feature requests (or explanation of how to do 'em if already there)

2014-10-24 22:57:53
1.  Most emails have both text and html parts nowadays.  If I'm reading such
   a message want to store the html part it always stores it with a .txt 
suffix.
   And, because browsers don't actually look at the contents, they treat it as
   a text file instead of a html file so I have to rename the file.  Would be
   nice if it stored it with a .htm or .html suffix.

FWIW, yeah, that totally bugs me as well.  It's on my list of things to fix
(but I'm kinda busy now, so it won't happen for a while).  In theory, I would
think it would be relatively easy, but I just have to trawl through a bunch
of code to figure out how that works.

2.  I have a whole pile of mail aliases for myself in my domain that I use for
   communications with different parties. I usually create a new one for every
   merchant with whom I do business.  If I receive an email directed to one of
   these aliases and reply to it it uses my address instead of the alias in 
the
   from and I always have to change it.  Would be nice if it used the incoming
   address.

You can actually do that now, with the existing format files.  Okay, yes,
the format language isn't wonderful, but you can use fmttest(1) to help
you debug that now.  This message actually uses that technique.  You
probably want something like:

From: %{to}

in there.  Or maybe:

From: Jon Steinhart %(addr{to}))

But you can also do something like this:

%<{delivered-to}%<(match kenh(_at_)pobox(_dot_)com)
From: Ken Hornstein <kenh(_at_)pobox(_dot_)com>
%(void(num 1))%|(void(num))%>%>
%<(zero)\
From: Ken Hornstein <work@address>
%>

Okay, there's more there, but I omitted it.  It's a bit wonky because
pobox.com will set a delivered-to header, but I didn't want to change
the address for any header, only if it's got my email address in it.
That's why I set the num register to indicate later on if I'm supposed to
put out my "fallback" email address.  If you don't need a multi-stage
test then you could simply have a sequence of %< .. %? .. %? .. %| .. %>.
I know, I know ... it looks complicated, but fmttest(1) does include
a -trace function if you get too confused (and -dump to dump out the
complete mh-format(5) program).

If you can't really make it happen inside of repl using mh-format(5),
you could write a wrapper to repl that sets an environment variable and
uses %(getenv).

--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>