nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] (n)mh tip of the day

2015-10-20 18:41:07
In the message dated: Tue, 20 Oct 2015 13:56:32 -0400,
The pithy ruminations from Ken Hornstein on 
<[Nmh-workers] (n)mh tip of the day> were:
=> I just came up with this, and I thought it might be useful to people.
=> 
=> I put in my components file the following line:
=> 
=> %<{from}%?(getenv MH_FROM)%|%(void(localmbox))%>%(void(width))%(putaddr 
From: )
=> 
=> That lets me, in priority order, set my From: header as the following:
=> 
=> - The -from switch to comp(1)
=> - The value of the MH_FROM environment variable
=> - Nmh's idea of my local mailbox (configured via Local-Mailbox, or if
=>   that's missing taking a guess based on the local username and hostname).
=> 
=> I have a few shell aliases which set MH_FROM to useful values.  I find
=> myself juggling multiple identities more and more, and I finally got tired
=> of editing my From: header by hand.  That's not the only piece of the
=> puzzle, though ... I have a postproc which submits the email to the
=> 'correct' SMTP server and my replcomps has a number of contortions to

I use sendmail's "smarttable" to choose the SMTP server based on recipient
domain (really just $WORK or non-work).

=> choose the correct From: header (that works actually surprisingly well
=> in practice).
=> 
=> As a question to everyone else: how do others who juggle multiple email
=> identities make it work?

For sending mail, I usually compose messages via claws-mail, for which
I've got several pre-configured 'identities' that populate the From,
Reply-To, Organization, & FCC headers, as well as setting the quoting
style & signature.

I've got some very dusty shell aliases to do the same, though they're probably
broken.



For replies, I use a perl wrapper around "repl" which examines headers to
determine which of my accounts received the mail, and the corresponding
'identity' to use in the reply. The wrapper has a config file that
defines what fields (From, FCC, signature, etc) to use for each identify.

The wrapper sets environment variables to contain different valies for
the From, Reply-To, and Fcc headers and the signature, then calls the real
"repl".

My replcomps, replgroupcomps, and repl.filter files refer to the environment
variables set in the wrapper in order to poulate fields, as in:

=========== replcomps =======================
%(lit)%(formataddr %<{reply-to}%?{from}%?{sender}%?{return-path}%>)\
%(void(width))%(putaddr To: )
%(lit)%(formataddr{to})%(formataddr{cc})%(formataddr(me))\
%(formataddr{resent-to})%(formataddr{resent-cc})\
%<(nonnull)%(void(width))%(putaddr cc: )\n%>\
CC:
%(void(getenv REPLMASQ))From: %(putstr)
Reply-To: %(putstr)
%(void(getenv REPLMASQFCC))Fcc: %(putstr)
Subject: %<{subject}Re: %{subject}%>
%<{message-id}%<{date}In-Reply-To: Your message of
"%<(nodate{date})%{date}%|%(pretty{date})%>%>." %{mes
sage-id}\nReferences: %{message-id}%<{references} %{references}%>\n%>\
-----\n
=================================================================

============= repl.filter =================
subject:nocompress,nocomponent,formatfield="%(void(getenv SIGNATURE))%(putstr)"
==============================

I've attached the wrapper.

To see the documentation:

        pod   repl.wrapper
    -or-
        repl.wrapper --wrap--D

To generate the skeleton of a config file:

        repl.wrapper --wrap--C

Comments welcome.

Mark

=> 
=> --Ken
=> 
-- 
Mark Bergman    Biker, Rock Climber, SCUBA Diver, Unix mechanic, IATSE #1 Stage
hand
'94 Yamaha GTS1000A^2
bergman(_at_)panix(_dot_)com

http://wwwkeys.pgp.net:11371/pks/lookup?op=get&search=bergman%40panix.com

I want a newsgroup with a infinite S/N ratio! Now taking CFV on:
rec.motorcycles.stagehands.pet-bird-owners.pinballers.unix-supporters
15+ So Far--Want to join? Check out: http://www.panix.com/~bergman 

Attachment: repl
Description: repl

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