1 Return-Path: <dmitry.kurochkin@gmail.com>
\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 olra.theworths.org (Postfix) with ESMTP id 1616A429E20
\r
6 for <notmuch@notmuchmail.org>; Mon, 9 May 2011 05:06:24 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=1.7 tagged_above=-999 required=5
\r
12 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
\r
13 FREEMAIL_FROM=0.001, FREEMAIL_REPLY=2.499, RCVD_IN_DNSWL_LOW=-0.7]
\r
15 Received: from olra.theworths.org ([127.0.0.1])
\r
16 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
17 with ESMTP id hGjuK42mhZRe for <notmuch@notmuchmail.org>;
\r
18 Mon, 9 May 2011 05:06:22 -0700 (PDT)
\r
19 Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com
\r
20 [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
21 (No client certificate requested)
\r
22 by olra.theworths.org (Postfix) with ESMTPS id 09229431FB5
\r
23 for <notmuch@notmuchmail.org>; Mon, 9 May 2011 05:06:21 -0700 (PDT)
\r
24 Received: by fxm8 with SMTP id 8so3825315fxm.26
\r
25 for <notmuch@notmuchmail.org>; Mon, 09 May 2011 05:06:20 -0700 (PDT)
\r
26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
\r
27 h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer;
\r
28 bh=m0TwHfonWSWseCLsAsQP150knKvkxP1Wdo5cned05RI=;
\r
29 b=Hc84PR24ZY42Dx79M8zcl7HxDh8lDQIdcq33VRJ2+iy7TqoyNZffZ8WLWtU+jx+C86
\r
30 t++3lSLmGcW2TWGfPhbfE+QqfMfEPRVl7kCIsmQG6tbJVABv8pu+99uuKWmc1IXmvGh5
\r
31 5XhgqCdovOEfqPIAj9wyUJe+s/P9mpTiFqJKY=
\r
32 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
\r
33 h=from:to:cc:subject:date:message-id:x-mailer;
\r
34 b=dWQMD0DRoAOZvjwaTytkHWHwyuy+32nD9Ja+v1UGYUeSajQfJV2ksRldbVctGg2BtX
\r
35 loBconJJ4olnJxHauhH7z7fkafWDctlPXwPyZKDnoUaCW6um2Cekq58xEOSFfpce9yiE
\r
36 v1imazK8xQgorkV0XGyjH9Yi72QkDz/Vs37wY=
\r
37 Received: by 10.223.113.193 with SMTP id b1mr1998933faq.47.1304942780190;
\r
38 Mon, 09 May 2011 05:06:20 -0700 (PDT)
\r
39 Received: from localhost ([91.144.186.21])
\r
40 by mx.google.com with ESMTPS id o20sm94353fal.1.2011.05.09.05.06.18
\r
41 (version=TLSv1/SSLv3 cipher=OTHER);
\r
42 Mon, 09 May 2011 05:06:19 -0700 (PDT)
\r
43 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
\r
44 To: Notmuch Mail <notmuch@notmuchmail.org>
\r
45 Subject: [PATCH] Use message-field-value instead of message-fetch-field in FCC
\r
47 Date: Mon, 9 May 2011 16:06:20 +0400
\r
48 Message-Id: <1304942780-4228-1-git-send-email-dmitry.kurochkin@gmail.com>
\r
49 X-Mailer: git-send-email 1.7.5.1
\r
50 X-BeenThere: notmuch@notmuchmail.org
\r
51 X-Mailman-Version: 2.1.13
\r
53 List-Id: "Use and development of the notmuch mail system."
\r
54 <notmuch.notmuchmail.org>
\r
55 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
56 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
57 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
58 List-Post: <mailto:notmuch@notmuchmail.org>
\r
59 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
60 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
61 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
62 X-List-Received-Date: Mon, 09 May 2011 12:06:24 -0000
\r
64 For message-fetch-field the buffer is expected to be narrowed to
\r
65 just the header of the message. That is not the case when
\r
66 notmuch-fcc-header-setup is run, hence a wrong header value may be
\r
67 returned. E.g. when forwarding an
\r
68 email, (message-fetch-field "From") returns the From header value
\r
69 of the forwarded email.
\r
71 Message-field-value is the same as message-fetch-field, only
\r
72 narrows the buffer to the headers first.
\r
75 The patch is for the release-candidate/0.6 branch. It is an amended
\r
76 version of a patch I sent a while ago
\r
77 id:"1278000507-22290-4-git-send-email-dmitry.kurochkin@gmail.com".
\r
83 emacs/notmuch-maildir-fcc.el | 6 +++---
\r
84 1 files changed, 3 insertions(+), 3 deletions(-)
\r
86 diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
\r
87 index 3f1c124..aede753 100644
\r
88 --- a/emacs/notmuch-maildir-fcc.el
\r
89 +++ b/emacs/notmuch-maildir-fcc.el
\r
90 @@ -80,7 +80,7 @@ will NOT be removed or replaced."
\r
93 ((or (not notmuch-fcc-dirs)
\r
94 - (message-fetch-field "Fcc"))
\r
95 + (message-field-value "Fcc"))
\r
96 ;; Nothing set or an existing header.
\r
99 @@ -93,7 +93,7 @@ will NOT be removed or replaced."
\r
100 (error "Invalid `notmuch-fcc-dirs' setting (old style)"))
\r
102 ((listp notmuch-fcc-dirs)
\r
103 - (let* ((from (message-fetch-field "From"))
\r
104 + (let* ((from (message-field-value "From"))
\r
106 (catch 'first-match
\r
107 (dolist (re-folder notmuch-fcc-dirs)
\r
108 @@ -118,7 +118,7 @@ will NOT be removed or replaced."
\r
109 (concat (notmuch-database-path) "/" subdir)))))
\r
111 ;; finally test if fcc points to a valid maildir
\r
112 - (let ((fcc-header (message-fetch-field "Fcc")))
\r
113 + (let ((fcc-header (message-field-value "Fcc")))
\r
114 (unless (notmuch-maildir-fcc-dir-is-maildir-p fcc-header)
\r
115 (cond ((not (file-writable-p fcc-header))
\r
116 (error (format "No permission to create %s, which does not exist"
\r