Missing headers when forwarding html message as RFC822
[notmuch-archives.git] / 7e / 44875087f88217d1c2aa96031b4ed1e8a993d9
1 Return-Path: <m.walters@qmul.ac.uk>\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 9B779431FB6\r
6         for <notmuch@notmuchmail.org>; Sun, 26 May 2013 00:05:12 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id DpCNB63-pF4h for <notmuch@notmuchmail.org>;\r
17         Sun, 26 May 2013 00:05:05 -0700 (PDT)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id CC99B431FAE\r
22         for <notmuch@notmuchmail.org>; Sun, 26 May 2013 00:05:04 -0700 (PDT)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1UgV0m-0006KM-Bo; Sun, 26 May 2013 08:05:00 +0100\r
27 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
28         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
29         (envelope-from <m.walters@qmul.ac.uk>)\r
30         id 1UgV0m-0005Mi-1O; Sun, 26 May 2013 08:05:00 +0100\r
31 From: Mark Walters <markwalters1009@gmail.com>\r
32 To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org\r
33 Subject: Re: [PATCH v2] emacs: Don't override mm-show-part in\r
34         notmuch-show-view-part\r
35 In-Reply-To: <1369550086-26986-1-git-send-email-amdragon@mit.edu>\r
36 References: <8761ycc19t.fsf@qmul.ac.uk>\r
37         <1369550086-26986-1-git-send-email-amdragon@mit.edu>\r
38 User-Agent: Notmuch/0.14+255~gff3cc55 (http://notmuchmail.org) Emacs/23.4.1\r
39         (x86_64-pc-linux-gnu)\r
40 Date: Sun, 26 May 2013 08:04:59 +0100\r
41 Message-ID: <874ndq2pd0.fsf@qmul.ac.uk>\r
42 MIME-Version: 1.0\r
43 Content-Type: text/plain; charset=us-ascii\r
44 X-Sender-Host-Address: 93.97.24.31\r
45 X-QM-SPAM-Info: Sender has good ham record.  :)\r
46 X-QM-Body-MD5: 01b4158ce91d9743d5449e3aa5bc2201 (of first 20000 bytes)\r
47 X-SpamAssassin-Score: -0.1\r
48 X-SpamAssassin-SpamBar: /\r
49 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
50         determine if it is\r
51         spam. We require at least 5.0 points to mark a message as spam.\r
52         This message scored -0.1 points.\r
53         Summary of the scoring: \r
54         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
55         provider *      (markwalters1009[at]gmail.com)\r
56         * -0.1 AWL AWL: From: address is in the auto white-list\r
57 X-QM-Scan-Virus: ClamAV says the message is clean\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.13\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62         <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Sun, 26 May 2013 07:05:13 -0000\r
71 \r
72 \r
73 LGTM +1\r
74 \r
75 This does not rely on the followup Austin mentioned in id:20130526063627.GQ5999@mit.edu is\r
76 so I think this should go in as is as it fixes the\r
77 flet thing without changing the behaviour.\r
78 \r
79 Best wishes\r
80 \r
81 Mark\r
82 \r
83 On Sun, 26 May 2013, Austin Clements <amdragon@MIT.EDU> wrote:\r
84 > Previously, notmuch-show-view-part overrode the function binding of\r
85 > mm-show-part to redirect it to notmuch-show-save-part to get notmuch's\r
86 > default file name handling in case mm-display-part decided to fall\r
87 > back to saving the part.  In addition to being messy, this depended on\r
88 > the now-deprecated dynamic binding behavior of flet.\r
89 >\r
90 > This patch removes the mm-show-part override in favor of passing the\r
91 > file name in to mm-show-part the way it expects, so we get its default\r
92 > file name handling.  It's not clear why we didn't do this before;\r
93 > mm-show-part has supported default file names since at least Emacs\r
94 > 23.1.\r
95 > ---\r
96 > This version overrides the default save directory to make it\r
97 > consistent with `notmuch-show-save-part'.\r
98 >\r
99 >  emacs/notmuch-show.el |   23 +++++++++--------------\r
100 >  1 file changed, 9 insertions(+), 14 deletions(-)\r
101 >\r
102 > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
103 > index 423dd58..d773396 100644\r
104 > --- a/emacs/notmuch-show.el\r
105 > +++ b/emacs/notmuch-show.el\r
106 > @@ -528,20 +528,15 @@ message at DEPTH in the current thread."\r
107 >  \r
108 >  (defun notmuch-show-view-part (message-id nth &optional filename content-type )\r
109 >    (notmuch-with-temp-part-buffer message-id nth\r
110 > -    ;; set mm-inlined-types to nil to force an external viewer\r
111 > -    (let ((handle (mm-make-handle (current-buffer) (list content-type)))\r
112 > -       (mm-inlined-types nil))\r
113 > -      ;; We override mm-save-part as notmuch-show-save-part is better\r
114 > -      ;; since it offers the filename. We need to lexically bind\r
115 > -      ;; everything we need for notmuch-show-save-part to prevent\r
116 > -      ;; potential dynamic shadowing.\r
117 > -      (lexical-let ((message-id message-id)\r
118 > -                 (nth nth)\r
119 > -                 (filename filename)\r
120 > -                 (content-type content-type))\r
121 > -     (flet ((mm-save-part (&rest args) (notmuch-show-save-part\r
122 > -                                        message-id nth filename content-type)))\r
123 > -       (mm-display-part handle))))))\r
124 > +    (let* ((disposition (if filename `(attachment (filename . ,filename))))\r
125 > +        (handle (mm-make-handle (current-buffer) (list content-type)\r
126 > +                                nil nil disposition))\r
127 > +        ;; Set the default save directory to be consistent with\r
128 > +        ;; `notmuch-show-save-part'.\r
129 > +        (mm-default-directory (or mailcap-download-directory "~/"))\r
130 > +        ;; set mm-inlined-types to nil to force an external viewer\r
131 > +        (mm-inlined-types nil))\r
132 > +      (mm-display-part handle))))\r
133 >  \r
134 >  (defun notmuch-show-interactively-view-part (message-id nth &optional filename content-type)\r
135 >    (notmuch-with-temp-part-buffer message-id nth\r
136 > -- \r
137 > 1.7.10.4\r