--- /dev/null
+Return-Path: <mailinglists@nawaz.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 9CCA06DE021D\r
+ for <notmuch@notmuchmail.org>; Sun, 19 Jul 2015 10:05:21 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.12\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.12 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01,\r
+ RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id eaUWNRxl6R7D for <notmuch@notmuchmail.org>;\r
+ Sun, 19 Jul 2015 10:05:19 -0700 (PDT)\r
+X-Greylist: delayed 448 seconds by postgrey-1.35 at arlo;\r
+ Sun, 19 Jul 2015 10:05:19 PDT\r
+Received: from hapkido.dreamhost.com (hapkido.dreamhost.com [66.33.216.122])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 01FB66DE014A\r
+ for <notmuch@notmuchmail.org>; Sun, 19 Jul 2015 10:05:18 -0700 (PDT)\r
+Received: from homiemail-a32.g.dreamhost.com (sub4.mail.dreamhost.com\r
+ [69.163.253.135])\r
+ by hapkido.dreamhost.com (Postfix) with ESMTP id 302158F465\r
+ for <notmuch@notmuchmail.org>; Sun, 19 Jul 2015 09:57:50 -0700 (PDT)\r
+Received: from homiemail-a32.g.dreamhost.com (localhost [127.0.0.1])\r
+ by homiemail-a32.g.dreamhost.com (Postfix) with ESMTP id 8D379584076;\r
+ Sun, 19 Jul 2015 09:57:46 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=nawaz.org; h=mime-version\r
+ :content-type:content-transfer-encoding:date:from:to:cc:subject\r
+ :in-reply-to:references:message-id; s=nawaz.org; bh=fe4Y7s/EeU2g\r
+ OZhqp6xSMhRWj4U=; b=G1OH1+9BTprgcxAi+lW9InicQDSomydTDC9o7WB6lnZL\r
+ McgXmypooGM/p6oXhnYOK9g8VlW5+rk3/bbubudBcDNLUZx3U2OyQ9Yuq4pc2aTN\r
+ bVnybWFLhqCqVV4PPkbnaZEy7BiDMFCGbDCcSBq6F/byEo4E/beDZr4OM2ORdMA=\r
+Received: from roundcube.dreamhost.com (caiajhbihbdd.dreamhost.com\r
+ [208.97.187.133]) (Authenticated sender: mueen@nawaz.org)\r
+ by homiemail-a32.g.dreamhost.com (Postfix) with ESMTPA id 88D8F584074;\r
+ Sun, 19 Jul 2015 09:57:46 -0700 (PDT)\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=UTF-8;\r
+ format=flowed\r
+Content-Transfer-Encoding: 7bit\r
+Date: Sun, 19 Jul 2015 09:57:46 -0700\r
+From: MN <mailinglists@nawaz.org>\r
+To: David Bremner <david@tethera.net>\r
+Subject: Re: Modify message after =?UTF-8?Q?send=2E=2E=2E=3F?=\r
+In-Reply-To: <87a8uswpan.fsf@maritornes.cs.unb.ca>\r
+References: <878uacpwse.fsf@fester.com> <87a8uswpan.fsf@maritornes.cs.unb.ca>\r
+Message-ID: <7d2fea075322f8a87ddfc3082eb4964d@nawaz.org>\r
+X-Sender: mailinglists@nawaz.org\r
+User-Agent: Roundcube Webmail/0.8.2\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 19 Jul 2015 17:05:21 -0000\r
+\r
+On 2015-07-19 00:59, David Bremner wrote:\r
+> mailinglists@nawaz.org writes:\r
+>\r
+>> BTW, all I really want to do is modify the From: field based on the\r
+>> recipients (for every email, with no default From). I'll welcome\r
+>> suggestions for existing ways to do that. I Googled a little, but \r
+>> didn't\r
+>> find a clear good solution. Furthermore, I expect over time the \r
+>> rules by\r
+>> which I pick the From: field will get more complex than my knowledge \r
+>> of\r
+>> Elisp.\r
+>\r
+> I'm afraid it's a bit "some-assembly-required", but let me mention \r
+> one\r
+> possible solution.\r
+>\r
+> At least if you just want to have a regular expression match on the\r
+> recipient, then the example configuration in message-templ [1] may be\r
+> enough to get you started. You'd have to either call\r
+> message-templ-config-exec in a hook, or bind it to a key and call it\r
+> manually to set up the headers before sending.\r
+>\r
+> [1]: http://pivot.cs.unb.ca/git?p=message-templ.git;a=tree\r
+\r
+Thanks for this. I'll see if I can follow the Elisp code.\r
+\r
+After sending my email, it occurred to me that message handling is not \r
+notmuch's job - that's passed on to message-mode. I figured message-mode \r
+must have some kind of hook before sending the email, and sure enough, \r
+it does have message-send-hook. The example at \r
+www.gnu.org/software/emacs/manual/html_mono/message.html shows how one \r
+can add headers before sending. There's also message-alternative-emails, \r
+although that likely works only if you're replying to an email.\r
+\r
+A little frustrating: They have a number of functions to modify/read \r
+fields like Subject, or To - but none for From! So I'll still have to do \r
+some surgery. I'll likely use the send-message-hook to:\r
+\r
+1. Read the "To" & "cc" values.\r
+2. Pass them to an external Python script.\r
+3. Get the appropriate "From" field from the Python script.\r
+4. Insert it into the From: field.\r
+\r
+How does one do steps 2 & 3 in Elisp? I just need a pointer. (Just \r
+Googled and saw this: \r
+http://stackoverflow.com/questions/5014246/how-to-capture-standard-output-of-a-shell-command-in-elisp)\r
+\r
+Thanks,\r