[Top][All Lists]

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

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

From: bergman
Subject: Re: [Nmh-workers] (n)mh tip of the day
Date: Tue, 20 Oct 2015 19:40:34 -0400

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

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

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: )
%<(nonnull)%(void(width))%(putaddr cc: )\n%>\
%(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%>\

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

I've attached the wrapper.

To see the documentation:

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

To generate the skeleton of a config file:

        repl.wrapper --wrap--C

Comments welcome.


=> --Ken
Mark Bergman    Biker, Rock Climber, SCUBA Diver, Unix mechanic, IATSE #1 Stage
'94 Yamaha GTS1000A^2


I want a newsgroup with a infinite S/N ratio! Now taking CFV on:
15+ So Far--Want to join? Check out: http://www.panix.com/~bergman 

Attachment: repl
Description: repl

reply via email to

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