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 olra.theworths.org (Postfix) with ESMTP id B1587431FBC
\r
6 for <notmuch@notmuchmail.org>; Fri, 12 Feb 2010 07:04:00 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-1.062 tagged_above=-999 required=5
\r
12 tests=[AWL=-0.877, BAYES_40=-0.185] autolearn=ham
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id L4-hcarvUYTK for <notmuch@notmuchmail.org>;
\r
16 Fri, 12 Feb 2010 07:03:59 -0800 (PST)
\r
17 Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.158])
\r
18 by olra.theworths.org (Postfix) with ESMTP id A8F3E431FAE
\r
19 for <notmuch@notmuchmail.org>; Fri, 12 Feb 2010 07:03:59 -0800 (PST)
\r
20 Received: by fg-out-1718.google.com with SMTP id e12so263064fga.2
\r
21 for <notmuch@notmuchmail.org>; Fri, 12 Feb 2010 07:03:58 -0800 (PST)
\r
22 Received: by 10.86.239.1 with SMTP id m1mr2874615fgh.57.1265987038668;
\r
23 Fri, 12 Feb 2010 07:03:58 -0800 (PST)
\r
24 Received: from aw.hh.sledj.net (gmp-ea-fw-1b.sun.com [192.18.8.1])
\r
25 by mx.google.com with ESMTPS id d4sm1172241fga.3.2010.02.12.07.03.57
\r
26 (version=TLSv1/SSLv3 cipher=RC4-MD5);
\r
27 Fri, 12 Feb 2010 07:03:57 -0800 (PST)
\r
28 Received: by aw.hh.sledj.net (Postfix, from userid 1000)
\r
29 id 62EB53A03A; Fri, 12 Feb 2010 15:03:39 +0000 (GMT)
\r
30 To: notmuch <notmuch@notmuchmail.org>
\r
31 From: David Edmondson <dme@dme.org>
\r
32 Date: Fri, 12 Feb 2010 15:03:39 +0000
\r
33 Message-ID: <87zl3esdh0.fsf@aw.hh.sledj.net>
\r
35 Content-Type: multipart/mixed; boundary="=-=-="
\r
36 Subject: [notmuch] [RFC] improved display of message/rfc822 parts
\r
37 X-BeenThere: notmuch@notmuchmail.org
\r
38 X-Mailman-Version: 2.1.13
\r
40 List-Id: "Use and development of the notmuch mail system."
\r
41 <notmuch.notmuchmail.org>
\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
43 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
45 List-Post: <mailto:notmuch@notmuchmail.org>
\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
48 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
49 X-List-Received-Date: Fri, 12 Feb 2010 15:04:00 -0000
\r
53 I seem to get a lot of forwarded message/rfc822 parts and the default
\r
54 formatting (which is to inline the contents of the included message) is
\r
57 Attached is a patch which attempts to improve this. Given that I'm new
\r
58 to notmuch hacking, any comments would be appreciated.
\r
62 Content-Type: text/x-diff
\r
63 Content-Disposition: inline;
\r
64 filename=0001-show-Make-message-rfc822-parts-explicit-in-show-outp.patch
\r
66 >From 7fd7ad00f4b8f8a2610eb15eeee98a1c0bb4351e Mon Sep 17 00:00:00 2001
\r
67 From: David Edmondson <dme@dme.org>
\r
68 Date: Fri, 12 Feb 2010 15:01:06 +0000
\r
69 Subject: [PATCH] show: Make message/rfc822 parts explicit in show output.
\r
70 show: Display header information for message/rfc822 parts.
\r
73 notmuch-show.c | 32 ++++++++++++++++++++++++++++++++
\r
74 1 files changed, 32 insertions(+), 0 deletions(-)
\r
76 diff --git a/notmuch-show.c b/notmuch-show.c
\r
77 index 376aacd..6f12560 100644
\r
78 --- a/notmuch-show.c
\r
79 +++ b/notmuch-show.c
\r
80 @@ -97,6 +97,34 @@ show_part_content (GMimeObject *part)
\r
84 +show_message_rfc822 (GMimeObject *part, int *part_count,
\r
85 + void (*show_part) (GMimeObject *part, int *part_count))
\r
87 + GMimeMessage *message;
\r
88 + const char *headers[] = {
\r
89 + "Subject", "From", "To", "Cc", "Bcc", "Date"
\r
91 + const char *name, *value;
\r
94 + *part_count = *part_count + 1;
\r
96 + message = g_mime_message_part_get_message (GMIME_MESSAGE_PART (part));
\r
99 + for (i = 0; i < ARRAY_SIZE (headers); i++) {
\r
100 + name = headers[i];
\r
101 + value = g_mime_object_get_header (GMIME_OBJECT (message), name);
\r
103 + printf ("%s: %s\n", name, value);
\r
107 + show_part (g_mime_message_get_mime_part (message),
\r
112 show_part (GMimeObject *part, int *part_count)
\r
114 GMimeContentDisposition *disposition;
\r
115 @@ -137,6 +165,10 @@ show_part (GMimeObject *part, int *part_count)
\r
117 show_part_content (part);
\r
119 + else if (g_mime_content_type_is_type (content_type, "message", "rfc822"))
\r
121 + show_message_rfc822 (part, part_count, show_part);
\r
125 printf ("Non-text part: %s\n",
\r
135 David Edmondson, http://dme.org
\r