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 79460431FC7
\r
6 for <notmuch@notmuchmail.org>; Fri, 2 Mar 2012 21:20:33 -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 Cr1raQch2hDa for <notmuch@notmuchmail.org>;
\r
16 Fri, 2 Mar 2012 21:20:32 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id 099AD431FBC
\r
20 for <notmuch@notmuchmail.org>; Fri, 2 Mar 2012 21:20:31 -0800 (PST)
\r
21 X-AuditID: 12074425-b7f4a6d0000008e0-62-4f51aa1fa178
\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])
\r
23 by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 0C.09.02272.F1AA15F4; Sat, 3 Mar 2012 00:20:31 -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 q235KUKS017467;
\r
27 Sat, 3 Mar 2012 00:20:30 -0500
\r
28 Received: from drake.mit.edu
\r
29 (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com
\r
30 [209.6.116.242]) (authenticated bits=0)
\r
31 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
32 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q235KTYJ022244
\r
33 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
34 Sat, 3 Mar 2012 00:20:30 -0500 (EST)
\r
35 Received: from amthrax by drake.mit.edu with local (Exim 4.77)
\r
36 (envelope-from <amthrax@drake.mit.edu>)
\r
37 id 1S3hOP-0000gy-DF; Sat, 03 Mar 2012 00:20:29 -0500
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH 2/5] show: Move format_message_mbox with the other new-style
\r
42 Date: Sat, 3 Mar 2012 00:20:22 -0500
\r
43 Message-Id: <1330752025-2542-3-git-send-email-amdragon@mit.edu>
\r
44 X-Mailer: git-send-email 1.7.7.3
\r
45 In-Reply-To: <1330752025-2542-1-git-send-email-amdragon@mit.edu>
\r
46 References: <1330752025-2542-1-git-send-email-amdragon@mit.edu>
\r
47 X-Brightmail-Tracker:
\r
48 H4sIAAAAAAAAA+NgFtrIIsWRmVeSWpSXmKPExsUixG6nriu/KtDf4M93RYvrN2cyOzB6PFt1
\r
49 izmAMYrLJiU1J7MstUjfLoEr49Gsj4wF5yUqJq49ydrA+Eioi5GTQ0LARGLnmj+MELaYxIV7
\r
50 69lAbCGBfYwSu6fUdzFyAdnrGSUOnz3MDOHcY5LoXnKPHcKZzyhx/MAbVpAWNgENiW37l4ON
\r
51 EhGQlth5dzZQnIODWUBN4k+XCogpLBAi0fQLbAGLgKrEnud3WEBsXgF7iZMXeqCOUJA4t/oc
\r
52 O4jNKeAg0XL8GCvEQfYSP/o7WSYw8i9gZFjFKJuSW6Wbm5iZU5yarFucnJiXl1qka6GXm1mi
\r
53 l5pSuokRHDIuqjsYJxxSOsQowMGoxMNb+TzAX4g1say4MvcQoyQHk5Iob/nyQH8hvqT8lMqM
\r
54 xOKM+KLSnNTiQ4wSHMxKIrzLPIFyvCmJlVWpRfkwKWkOFiVxXk2td35CAumJJanZqakFqUUw
\r
55 WRkODiUJ3qiVQI2CRanpqRVpmTklCGkmDk6Q4TxAw1tBaniLCxJzizPTIfKnGBWlxHlzQRIC
\r
56 IImM0jy4XlhMv2IUB3pFmDcApIoHmA7gul8BDWYCGrz4sh/I4JJEhJRUA+NcwVK92x/WPlYU
\r
57 YYpcmrLyU9L7HJNDrgYSAu92zqj696KUVaSUfYfa53Lx0uvK3trHFybdq1trtV+isbeYt8p9
\r
58 tXHno3vHnH1iF3z4uUJD5b1+isSXjtj3rNa7Mu5LneFaKc3xbt/DQl99yWyJ12q1Xbxdb17u
\r
59 ajG3dpCo3NzMsOid+reFe5RYijMSDbWYi4oTAbDtVRHEAgAA
\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: Sat, 03 Mar 2012 05:20:33 -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