1 Return-Path: <dme@dme.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 61D046DE0159
\r
6 for <notmuch@notmuchmail.org>; Sat, 30 Jul 2016 07:12:22 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org
\r
11 X-Spam-Status: No, score=-0.191 tagged_above=-999 required=5
\r
12 tests=[AWL=-0.124, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
\r
13 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,
\r
14 RCVD_IN_MSPIKE_WL=-0.01, SPF_NEUTRAL=0.652, UNPARSEABLE_RELAY=0.001]
\r
16 Received: from arlo.cworth.org ([127.0.0.1])
\r
17 by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)
\r
18 with ESMTP id FHo9EhcE9kLc for <notmuch@notmuchmail.org>;
\r
19 Sat, 30 Jul 2016 07:12:14 -0700 (PDT)
\r
20 Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com
\r
21 [74.125.82.52]) by arlo.cworth.org (Postfix) with ESMTPS id CA8326DE00F5 for
\r
22 <notmuch@notmuchmail.org>; Sat, 30 Jul 2016 07:12:13 -0700 (PDT)
\r
23 Received: by mail-wm0-f52.google.com with SMTP id f65so320280541wmi.0
\r
24 for <notmuch@notmuchmail.org>; Sat, 30 Jul 2016 07:12:13 -0700 (PDT)
\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
26 d=dme-org.20150623.gappssmtp.com; s=20150623;
\r
27 h=to:subject:in-reply-to:references:from:date:message-id:mime-version;
\r
28 bh=OBBsQTs5Gd5Z/5UbLlhX8sWSiDWjUhdTG+wCDm9JH8g=;
\r
29 b=pp9c1HJZQ4J5fdTUy5hNfU0qQueFVk+2pjd/E3lcRvlZ7S3hoSIe3UX/seZNADRG8+
\r
30 XG0t4Owwf2gAXfO8v8WZbJPXBlvRgtZt/GQx9dxWCpP/NryxLpeSWUdsRM8kxbsZTtVl
\r
31 kzn/SeBH1yXa/FnPC/HyeTZ+jlrtSGXFbF/UjdOIXt9BP92rTahiIAzhBOypbxNcjSpL
\r
32 VPlOsA36ayWJq2UrHkqxShnMSgPk1GDyxyZlEp+dCVELqf0ZfX6Vbxo7rbf+f3ozu0oC
\r
33 hAwd5BDeGgitMxFkw51tbkTJdCvPaDwI9Oy8uxyPuvz4fg8dOwsSLxANktKqkDcMA71Y
\r
35 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
\r
36 d=1e100.net; s=20130820;
\r
37 h=x-gm-message-state:to:subject:in-reply-to:references:from:date
\r
38 :message-id:mime-version;
\r
39 bh=OBBsQTs5Gd5Z/5UbLlhX8sWSiDWjUhdTG+wCDm9JH8g=;
\r
40 b=dlgNSHgwx4R5WOVFJRhHsVvvI8F/XJEWWCdHm96VIm3XhdxsnrDVxIh6mUSGD0wj5c
\r
41 Zo68dcXGW3JyJ33yNW9U7/fORUbeQtOFLa4TYKJcOtfij9O/zG08zvG9n2trnvOdRwKD
\r
42 3dHFAXc8tc6kE9VpAZDOBsgLZ2jKbSzHclvOsFJK1fuIEC/CgG2Tvtczeg7JH2Vv0EYk
\r
43 OF2Dfcigfh3t+M75gnnVutmVhjnxjGt/vrH/qIBNkr7SJ8wu01TtSYF8zp/FjJ1kxQo5
\r
44 /JzzmVRhwJnfFuS4zevvpLLjL6yB4JUQa/qGuH0hpydon/bnTzR8FIkkapObdKx4J6PA
\r
47 AEkoouu8DhVHhdRyGp1l1ONOEDPn8GnDKT5ShdU4IraUciTGSPM1CabM0Qdo15s3+HdXxA==
\r
48 X-Received: by 10.28.50.3 with SMTP id y3mr42351656wmy.23.1469887932116;
\r
49 Sat, 30 Jul 2016 07:12:12 -0700 (PDT)
\r
50 Received: from disaster-area.hh.sledj.net
\r
51 ([2a01:348:1a2:1:ea39:35ff:fe2c:a227])
\r
52 by smtp.gmail.com with ESMTPSA id n7sm21470579wjf.11.2016.07.30.07.12.10
\r
53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
\r
54 Sat, 30 Jul 2016 07:12:10 -0700 (PDT)
\r
55 Received: from localhost (disaster-area.hh.sledj.net [local])
\r
56 by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 69c63fc6;
\r
57 Sat, 30 Jul 2016 14:12:09 +0000 (UTC)
\r
58 To: Charlie Allom <charlie@yelp.com>, notmuch@notmuchmail.org
\r
59 Subject: Re: [PATCH v3] Allow content preference based on message content.
\r
61 <m1oa5fuv9v.fsf@YELP-CHARLIE.i-did-not-set--mail-host-address--so-tickle-me>
\r
62 References: <1459699478-21167-1-git-send-email-dme@dme.org>
\r
63 <m1oa5fuv9v.fsf@YELP-CHARLIE.i-did-not-set--mail-host-address--so-tickle-me>
\r
64 From: David Edmondson <dme@dme.org>
\r
65 Date: Sat, 30 Jul 2016 15:12:09 +0100
\r
66 Message-ID: <m21t2bb4g6.fsf@dme.org>
\r
68 Content-Type: text/plain
\r
69 X-BeenThere: notmuch@notmuchmail.org
\r
70 X-Mailman-Version: 2.1.20
\r
72 List-Id: "Use and development of the notmuch mail system."
\r
73 <notmuch.notmuchmail.org>
\r
74 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,
\r
75 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
76 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>
\r
77 List-Post: <mailto:notmuch@notmuchmail.org>
\r
78 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
79 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,
\r
80 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
81 X-List-Received-Date: Sat, 30 Jul 2016 14:12:22 -0000
\r
83 On Sat, Jul 30 2016, Charlie Allom wrote:
\r
85 > Do you have an example for the elisp-challenged, on how to match more
\r
86 > than one email address? I'm just starting out with emacs but this patch
\r
87 > is just what I need :)
\r
89 There are many ways. This is what I am using:
\r
91 (defun dme:determine-discouraged (msg)
\r
92 (let* ((headers (plist-get msg :headers))
\r
93 (from (or (plist-get headers :From) "")))
\r
95 ((string-match (regexp-opt
\r
97 ;; Parmiter's parent mail: text/plain with HTML content.
\r
98 "9195404@capita-intouch.co.uk"
\r
99 ;; Oracle mobile reports: text/plain with useless content.
\r
101 ;; Charles Stanley: HTML only emails.
\r
102 "info@charles-stanley-direct.co.uk"
\r
103 ;; HackerNews: nicer in HTML.
\r
104 "kale@hackernewsletter.com"
\r
105 ;; MasterCard: no content in the text.
\r
106 "CustomerService@information.mbna.co.uk"
\r
111 '("text/html" "multipart/related" "text/x-beehive-notification")))))
\r
117 > On Sun, Apr 03 2016 at 05:04:37 pm, David Edmondson <dme@dme.org> wrote:
\r
119 >> Allow content preference based on message content.
\r
121 >> An example configuration might be:
\r
123 >> (defun dme:determine-discouraged (msg)
\r
124 >> (let* ((headers (plist-get msg :headers))
\r
125 >> (from (or (plist-get headers :From) "")))
\r
127 >> ((string-match "9195404@capita-intouch.co.uk" from)
\r
128 >> '("text/plain"))
\r
130 >> '("text/html" "multipart/related")))))
\r
132 >> (setq notmuch-multipart/alternative-discouraged
\r
133 >> 'dme:determine-discouraged)
\r
135 >> This would discourage text/html and multipart/related generally, but
\r
136 >> discourage text/plain should the message be sent from
\r
137 >> 9195404@capita-intouch.co.uk.
\r
140 >> - Remove the simple evaluation variant based on feedback.
\r
143 >> - Merge forward.
\r
144 >> - Update the example to allow for a nil msg (which should no longer
\r
145 >> happen, but it's good to be safe).
\r
148 >> David Edmondson (1):
\r
149 >> emacs: Allow part preferences to depend on message content.
\r
151 >> emacs/notmuch-lib.el | 20 ++++++++++++++++----
\r
152 >> emacs/notmuch-show.el | 2 +-
\r
153 >> 2 files changed, 17 insertions(+), 5 deletions(-)
\r