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