From: Mark Walters Date: Fri, 31 Oct 2014 10:20:12 +0000 (+0000) Subject: Re: [PATCH v5 0/7] notmuch search --output=sender/recipients X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5922278b159a7d97cd18895aa26c7b212c335d14;p=notmuch-archives.git Re: [PATCH v5 0/7] notmuch search --output=sender/recipients --- diff --git a/59/05919435c47522f936fa4bd37db64fafbc1046 b/59/05919435c47522f936fa4bd37db64fafbc1046 new file mode 100644 index 000000000..6d424ce8f --- /dev/null +++ b/59/05919435c47522f936fa4bd37db64fafbc1046 @@ -0,0 +1,200 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 71F61431FC9 + for ; Fri, 31 Oct 2014 03:20:29 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id gHk3riEPUeIU for ; + Fri, 31 Oct 2014 03:20:21 -0700 (PDT) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id D49A8431FC2 + for ; Fri, 31 Oct 2014 03:20:20 -0700 (PDT) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1Xk9JW-0007nF-Jh; Fri, 31 Oct 2014 10:20:15 +0000 +Received: from 5751dfa2.skybroadband.com ([87.81.223.162] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71) + (envelope-from ) + id 1Xk9JW-0000iP-0I; Fri, 31 Oct 2014 10:20:14 +0000 +From: Mark Walters +To: Michal Sojka , notmuch@notmuchmail.org +Subject: Re: [PATCH v5 0/7] notmuch search --output=sender/recipients +In-Reply-To: <878ujwvctt.fsf@qmul.ac.uk> +References: <1414713573-21461-1-git-send-email-sojkam1@fel.cvut.cz> + <878ujwvctt.fsf@qmul.ac.uk> +User-Agent: Notmuch/0.18.1+86~gef5e66a (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Fri, 31 Oct 2014 10:20:12 +0000 +Message-ID: <8761f0v8v7.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary="=-=-=" +X-Sender-Host-Address: 87.81.223.162 +X-QM-Geographic: According to ripencc, + this message was delivered by a machine in Britain (UK) (GB). +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: 5ebe03903b698eeb8d2ec54df3e860b0 (of first 20000 bytes) +X-SpamAssassin-Score: -0.1 +X-SpamAssassin-SpamBar: / +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored -0.1 points. + Summary of the scoring: + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * -0.1 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Fri, 31 Oct 2014 10:20:29 -0000 + +--=-=-= +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: quoted-printable + + +Hi + +I attach a patch which does the quoting for real names but I don't know +if we want it: it changes (example taken from the test suite) + +Fran=C3=A7ois Boulogne to + +=3D?iso-8859-1?q?Fran=3DE7ois?=3D Boulogne + +(which is what was in the original email) + +Plausibly the best thing is just to leave the series as is, so the +text output is readable and parseable in the common cases. + +Anyway the patch is attached if anyone wants to experiment. + +Best wishes + +Mark + + +--=-=-= +Content-Type: text/x-diff; charset=utf-8 +Content-Disposition: attachment; + filename=0001-search-quote-real-names-for-output-sender-recipient-.patch +Content-Transfer-Encoding: quoted-printable + +>From 53b1ced2d6a9fbbba93448325f795e6b99faa240 Mon Sep 17 00:00:00 2001 +From: Mark Walters +Date: Fri, 31 Oct 2014 10:11:40 +0000 +Subject: [PATCH] search: quote real names for output=3Dsender/recipient in = +text + format + +This quotes the real name (when gmime thinks appropriate) for the text +output. For the other outputs the real name is separate from the +address so the consumer can do any quoting necessary. +--- + notmuch-search.c | 8 ++++---- + test/T090-search-output.sh | 8 ++++---- + 2 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/notmuch-search.c b/notmuch-search.c +index eae749a..8eac161 100644 +--- a/notmuch-search.c ++++ b/notmuch-search.c +@@ -47,6 +47,7 @@ typedef struct { + typedef struct { + const char *name; + const char *addr; ++ const char *string; + } mailbox_t; +=20 + /* Return two stable query strings that identify exactly the matched +@@ -255,15 +256,13 @@ print_mailbox (const search_options_t *opt, const mai= +lbox_t *mailbox) + { + const char *name =3D mailbox->name; + const char *addr =3D mailbox->addr; ++ const char *string =3D mailbox->string; + sprinter_t *format =3D opt->format; +=20 + if (format->is_text_printer) { + char *mailbox_str; +=20 +- if (name && *name) +- mailbox_str =3D talloc_asprintf (format, "%s <%s>", name, addr); +- else +- mailbox_str =3D talloc_strdup (format, addr); ++ mailbox_str =3D talloc_strdup (format, string); +=20 + if (! mailbox_str) { + fprintf (stderr, "Error: out of memory\n"); +@@ -309,6 +308,7 @@ process_address_list (const search_options_t *opt, GHas= +hTable *addrs, + mailbox_t mbx =3D { + .name =3D internet_address_get_name (address), + .addr =3D internet_address_mailbox_get_addr (mailbox), ++ .string =3D internet_address_to_string (address, TRUE), + }; +=20 + if (is_duplicate (opt, addrs, mbx.name, mbx.addr)) +diff --git a/test/T090-search-output.sh b/test/T090-search-output.sh +index 841a721..776e3f4 100755 +--- a/test/T090-search-output.sh ++++ b/test/T090-search-output.sh +@@ -390,7 +390,7 @@ test_expect_equal_file OUTPUT EXPECTED + test_begin_subtest "--output=3Dsender" + notmuch search --output=3Dsender '*' >OUTPUT + cat <EXPECTED +-Fran=C3=A7ois Boulogne ++=3D?iso-8859-1?q?Fran=3DE7ois?=3D Boulogne + Olivier Berger + Chris Wilson + Carl Worth +@@ -437,7 +437,7 @@ test_begin_subtest "--output=3Drecipients" + notmuch search --output=3Drecipients '*' >OUTPUT + cat <EXPECTED + Allan McRae +-Discussion about the Arch User Repository (AUR) ++"Discussion about the Arch User Repository (AUR)" + olivier.berger@it-sudparis.eu + notmuch@notmuchmail.org + notmuch +@@ -449,9 +449,9 @@ test_expect_equal_file OUTPUT EXPECTED + test_begin_subtest "--output=3Dsender --output=3Drecipients" + notmuch search --output=3Dsender --output=3Drecipients '*' >OUTPUT + cat <EXPECTED +-Fran=C3=A7ois Boulogne ++=3D?iso-8859-1?q?Fran=3DE7ois?=3D Boulogne + Allan McRae +-Discussion about the Arch User Repository (AUR) ++"Discussion about the Arch User Repository (AUR)" + Olivier Berger + olivier.berger@it-sudparis.eu + Chris Wilson +--=20 +1.7.10.4 + + +--=-=-=--