1 Return-Path: <amthrax@drake.mit.edu>
\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 1B9A1431FD5
\r
6 for <notmuch@notmuchmail.org>; Tue, 6 Mar 2012 10:48:53 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\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 leY1jjpNVReI for <notmuch@notmuchmail.org>;
\r
16 Tue, 6 Mar 2012 10:48:51 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id C0A12431FCF
\r
20 for <notmuch@notmuchmail.org>; Tue, 6 Mar 2012 10:48:51 -0800 (PST)
\r
21 X-AuditID: 12074423-b7f9c6d0000008c3-e4-4f565c139484
\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])
\r
23 by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id E2.FD.02243.31C565F4; Tue, 6 Mar 2012 13:48:51 -0500 (EST)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id q26ImpvM020738;
\r
27 Tue, 6 Mar 2012 13:48:51 -0500
\r
28 Received: from drake.mit.edu (firewall.royalsociety.org [193.63.75.2])
\r
29 (authenticated bits=0)
\r
30 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
31 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q26ImmXa016464
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Tue, 6 Mar 2012 13:48:50 -0500 (EST)
\r
34 Received: from amthrax by drake.mit.edu with local (Exim 4.77)
\r
35 (envelope-from <amthrax@drake.mit.edu>)
\r
36 id 1S4zRI-0003pP-6I; Tue, 06 Mar 2012 18:48:48 +0000
\r
37 From: Austin Clements <amdragon@MIT.EDU>
\r
38 To: notmuch@notmuchmail.org
\r
39 Subject: [PATCH v2 4/8] show: Move format_message_mbox with the other
\r
41 Date: Tue, 6 Mar 2012 18:48:40 +0000
\r
42 Message-Id: <1331059724-14653-5-git-send-email-amdragon@mit.edu>
\r
43 X-Mailer: git-send-email 1.7.7.3
\r
44 In-Reply-To: <1331059724-14653-1-git-send-email-amdragon@mit.edu>
\r
45 References: <1330752025-2542-1-git-send-email-amdragon@mit.edu>
\r
46 <1331059724-14653-1-git-send-email-amdragon@mit.edu>
\r
47 X-Brightmail-Tracker:
\r
48 H4sIAAAAAAAAA+NgFtrFIsWRmVeSWpSXmKPExsUixG6nriscE+ZvcGmnpMWefV4W12/OZHZg
\r
49 8rh7msvj2apbzAFMUVw2Kak5mWWpRfp2CVwZj2Z9ZCw4L1Exce1J1gbGR0JdjJwcEgImEg9P
\r
50 NbFD2GISF+6tZ+ti5OIQEtjHKHHt5nsoZz2jxMQl09ghnINMEp2/1zFBOPMZJdYf+8MI0s8m
\r
51 oCGxbf9yMFtEQFpi593ZrF2MHBzMAk4SbW1eIKawQLjEuR81IBUsAqoStyeAVHBy8Ao4SDSc
\r
52 OM0CcYWCxLnV58Au4hRwlNjzdBPYRCGBMolLNy+wTGDkX8DIsIpRNiW3Sjc3MTOnODVZtzg5
\r
53 MS8vtUjXTC83s0QvNaV0EyM4iFyUdzD+Oah0iFGAg1GJh7dKN8xfiDWxrLgy9xCjJAeTkihv
\r
54 ThRQiC8pP6UyI7E4I76oNCe1+BCjBAezkgjvt/eh/kK8KYmVValF+TApaQ4WJXFeDa13fkIC
\r
55 6YklqdmpqQWpRTBZGQ4OJQnejGigoYJFqempFWmZOSUIaSYOTpDhPEDDjUBqeIsLEnOLM9Mh
\r
56 8qcYFaXEef1AEgIgiYzSPLheWJS/YhQHekWYtw6kigeYIOC6XwENZgIa3KYcDDK4JBEhJdXA
\r
57 ePzhjKyFkks2vsq41PJ46ft4810/cl/beO96q/NhYvjyggbxlPcMlcVKQeeatznFnHLtCDrf
\r
58 Xu44pe3z6vCb/tmTt9y7tD3NQXunv32I6szKlZvirTluOr1acCTGkDXI79uxtBq7bf2f//Am
\r
59 L6vfxtbcNjXq73m1x8lrv1SzTC7RTk1wdFu/TYmlOCPRUIu5qDgRAJtwZU/NAgAA
\r
60 X-BeenThere: notmuch@notmuchmail.org
\r
61 X-Mailman-Version: 2.1.13
\r
63 List-Id: "Use and development of the notmuch mail system."
\r
64 <notmuch.notmuchmail.org>
\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
66 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
68 List-Post: <mailto:notmuch@notmuchmail.org>
\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
71 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
72 X-List-Received-Date: Tue, 06 Mar 2012 18:48:53 -0000
\r
76 notmuch-show.c | 100 ++++++++++++++++++++++++++++----------------------------
\r
77 1 files changed, 50 insertions(+), 50 deletions(-)
\r
79 diff --git a/notmuch-show.c b/notmuch-show.c
\r
80 index 648f468..b3a4550 100644
\r
81 --- a/notmuch-show.c
\r
82 +++ b/notmuch-show.c
\r
83 @@ -219,56 +219,6 @@ _is_from_line (const char *line)
\r
87 -/* Print a message in "mboxrd" format as documented, for example,
\r
90 - * http://qmail.org/qmail-manual-html/man5/mbox.html
\r
93 -format_message_mbox (const void *ctx,
\r
94 - notmuch_message_t *message,
\r
95 - unused (int indent))
\r
97 - const char *filename;
\r
102 - struct tm date_gmtime;
\r
103 - char date_asctime[26];
\r
105 - char *line = NULL;
\r
106 - size_t line_size;
\r
107 - ssize_t line_len;
\r
109 - filename = notmuch_message_get_filename (message);
\r
110 - file = fopen (filename, "r");
\r
111 - if (file == NULL) {
\r
112 - fprintf (stderr, "Failed to open %s: %s\n",
\r
113 - filename, strerror (errno));
\r
117 - from = notmuch_message_get_header (message, "from");
\r
118 - from = _extract_email_address (ctx, from);
\r
120 - date = notmuch_message_get_date (message);
\r
121 - gmtime_r (&date, &date_gmtime);
\r
122 - asctime_r (&date_gmtime, date_asctime);
\r
124 - printf ("From %s %s", from, date_asctime);
\r
126 - while ((line_len = getline (&line, &line_size, file)) != -1 ) {
\r
127 - if (_is_from_line (line))
\r
129 - printf ("%s", line);
\r
138 format_headers_message_part_text (GMimeMessage *message)
\r
140 @@ -762,6 +712,56 @@ format_part_json_entry (const void *ctx, mime_node_t *node, unused (int indent),
\r
141 return NOTMUCH_STATUS_SUCCESS;
\r
144 +/* Print a message in "mboxrd" format as documented, for example,
\r
147 + * http://qmail.org/qmail-manual-html/man5/mbox.html
\r
150 +format_message_mbox (const void *ctx,
\r
151 + notmuch_message_t *message,
\r
152 + unused (int indent))
\r
154 + const char *filename;
\r
156 + const char *from;
\r
159 + struct tm date_gmtime;
\r
160 + char date_asctime[26];
\r
162 + char *line = NULL;
\r
163 + size_t line_size;
\r
164 + ssize_t line_len;
\r
166 + filename = notmuch_message_get_filename (message);
\r
167 + file = fopen (filename, "r");
\r
168 + if (file == NULL) {
\r
169 + fprintf (stderr, "Failed to open %s: %s\n",
\r
170 + filename, strerror (errno));
\r
174 + from = notmuch_message_get_header (message, "from");
\r
175 + from = _extract_email_address (ctx, from);
\r
177 + date = notmuch_message_get_date (message);
\r
178 + gmtime_r (&date, &date_gmtime);
\r
179 + asctime_r (&date_gmtime, date_asctime);
\r
181 + printf ("From %s %s", from, date_asctime);
\r
183 + while ((line_len = getline (&line, &line_size, file)) != -1 ) {
\r
184 + if (_is_from_line (line))
\r
186 + printf ("%s", line);
\r
194 static notmuch_status_t
\r
195 show_message (void *ctx,
\r
196 const notmuch_show_format_t *format,
\r