Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 37 / 755c464b8ee0ec573a0fc1949799b35e7ffbd3
1 Return-Path:\r
2  <return-dqk5s59tpxtrvs7yjhukdm9c56@temporary-address.scs.stanford.edu>\r
3 X-Original-To: notmuch@notmuchmail.org\r
4 Delivered-To: notmuch@notmuchmail.org\r
5 Received: from localhost (localhost [127.0.0.1])\r
6  by arlo.cworth.org (Postfix) with ESMTP id C711C6DE0B27\r
7  for <notmuch@notmuchmail.org>; Tue, 21 Jul 2015 17:41:45 -0700 (PDT)\r
8 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: -2.055\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=-2.055 tagged_above=-999 required=5 tests=[AWL=0.796,\r
13   RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-0.55, SPF_PASS=-0.001]\r
14  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 daGRXxEK5NSx for <notmuch@notmuchmail.org>;\r
18  Tue, 21 Jul 2015 17:41:43 -0700 (PDT)\r
19 X-Greylist: delayed 1203 seconds by postgrey-1.35 at arlo;\r
20  Tue, 21 Jul 2015 17:41:43 PDT\r
21 Received: from market.scs.stanford.edu (market.scs.stanford.edu [171.66.3.10])\r
22  by arlo.cworth.org (Postfix) with ESMTPS id B32AC6DE0AD1\r
23  for <notmuch@notmuchmail.org>; Tue, 21 Jul 2015 17:41:43 -0700 (PDT)\r
24 Received: from market.scs.stanford.edu (localhost.scs.stanford.edu\r
25  [127.0.0.1]) by market.scs.stanford.edu (8.14.7/8.14.7) with ESMTP id\r
26  t6M0LbSw027122; Tue, 21 Jul 2015 17:21:37 -0700 (PDT)\r
27 Received: (from dm@localhost)\r
28  by market.scs.stanford.edu (8.14.7/8.14.7/Submit) id t6M0LbPk016153;\r
29  Tue, 21 Jul 2015 17:21:37 -0700 (PDT)\r
30 X-Authentication-Warning: market.scs.stanford.edu: dm set sender to\r
31  return-dqk5s59tpxtrvs7yjhukdm9c56@ta.scs.stanford.edu using -f\r
32 From: David Mazieres <dm-list-email-notmuch@scs.stanford.edu>\r
33 To: mailinglists@nawaz.org, notmuch@notmuchmail.org\r
34 Subject: Re: Modify message after send...?\r
35 In-Reply-To: <878uacpwse.fsf@fester.com>\r
36 References: <878uacpwse.fsf@fester.com>\r
37 Reply-To: David Mazieres expires 2015-10-19 PDT\r
38  <mazieres-ikhhtkgnuesn6x67wa9p6axshs@temporary-address.scs.stanford.edu>\r
39 Date: Tue, 21 Jul 2015 17:21:36 -0700\r
40 Message-ID: <87y4i9xcrz.fsf@ta.scs.stanford.edu>\r
41 MIME-Version: 1.0\r
42 Content-Type: text/plain\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.18\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47  <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Wed, 22 Jul 2015 00:41:45 -0000\r
56 \r
57 mailinglists@nawaz.org writes:\r
58 \r
59 > Hi,\r
60 >\r
61 > I use notmuch via Emacs.\r
62 >\r
63 > Here's what I want:\r
64 >\r
65 > When I hit C-c C-c to send a message, I'd like it to be passed to a\r
66 > script (likely a Python one, although I may consider an Elisp function\r
67 > if an external script is not possible) for modification of headers,\r
68 > before it is sent to the MTA (Postfix in my case). A bonus would be to\r
69 > have the modified message stored in the FCC location, instead of the\r
70 > original one.\r
71 >\r
72 > Is this possible? An alternative may be to modify the message /before/\r
73 > it goes to message-send-and-exit. I'm inexperienced in Elisp - would\r
74 > this be via what's called "advising"?\r
75 >\r
76 > BTW, all I really want to do is modify the From: field based on the\r
77 > recipients (for every email, with no default From). I'll welcome\r
78 > suggestions for existing ways to do that. I Googled a little, but didn't\r
79 > find a clear good solution. Furthermore, I expect over time the rules by\r
80 > which I pick the From: field will get more complex than my knowledge of\r
81 > Elisp.\r
82 \r
83 For modifying the From field, I recommend doing it before you send the\r
84 message, as this gives you an opportunity to see what you are about to\r
85 send and possibly edit it by hand.\r
86 \r
87 I do something like this using defadvice around notmuch-mua-mail, do\r
88 adjust things about my messages.  I also put a defadvice around\r
89 notmuch-call-notmuch-sexp to filter the To and Cc headers I get from\r
90 "notmuch reply" (because notmuch won't let me put wildcards in my\r
91 .notmuch-config file).\r
92 \r
93 Finally, and possibly most relevant to you, I use a message-send-hook to\r
94 insert the Return-Path address and make a few more modifications before\r
95 sending a message.  Note that I only do this if there isn't already a\r
96 Return-Path header.  That way, if I type C-c C-c and don't like what I\r
97 see, I edit the result and send again, leaving the generated Return-Path\r
98 header, and this time it goes through unmodified.\r
99 \r
100 David\r