From 223ca24b954b24a6989a9119a1057dd167575185 Mon Sep 17 00:00:00 2001 From: "Kevin J. McCarthy" Date: Sun, 8 Sep 2013 10:07:57 +1700 Subject: [PATCH] [PATCH v2 1/1] notmuch-mutt: Fix tagging issues --- 8a/d5004215f01fdc9e46582225e2ede96a72a093 | 140 ++++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 8a/d5004215f01fdc9e46582225e2ede96a72a093 diff --git a/8a/d5004215f01fdc9e46582225e2ede96a72a093 b/8a/d5004215f01fdc9e46582225e2ede96a72a093 new file mode 100644 index 000000000..14ab57a00 --- /dev/null +++ b/8a/d5004215f01fdc9e46582225e2ede96a72a093 @@ -0,0 +1,140 @@ +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 A8E90431FAF + for ; Sat, 7 Sep 2013 10:08:12 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 iKDMdIkjOTf9 for ; + Sat, 7 Sep 2013 10:08:08 -0700 (PDT) +Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com + [66.111.4.27]) + (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 46A89431FAE + for ; Sat, 7 Sep 2013 10:08:08 -0700 (PDT) +Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46]) + by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 33C92207A6; + Sat, 7 Sep 2013 13:08:00 -0400 (EDT) +Received: from frontend1 ([10.202.2.160]) + by compute6.internal (MEProxy); Sat, 07 Sep 2013 13:08:00 -0400 +DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=8t8.us; h=date + :from:to:cc:subject:message-id:references:mime-version + :content-type:in-reply-to; s=mesmtp; bh=IbZhmQNNUTQ5qeWtDbCt2OXs + us4=; b=cWmThUHOyWl4/zEpsda6ukfQYTSz2Y+ghivoev4Pi6A8MHKAlsKXbM+p + XMDvXCvxYjrUAloEkwuLoBtnuQqWFJ143KptVl/fyXrH4sEBuW5BV7zP4EjHytO6 + gC8/jVQsntsAZaObqeR8iD2k0jkNvVyuTRv9ERu6A0EzokltK/Y= +DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= + messagingengine.com; h=date:from:to:cc:subject:message-id + :references:mime-version:content-type:in-reply-to; s=smtpout; + bh=IbZhmQNNUTQ5qeWtDbCt2OXsus4=; b=AE92wIEu2FtpmSUwGjY9WijtKu3q + 7eeCGVopJ7jYrJ9IcDmqwDXQNGTJTKBtvyPdHeIIDuerKBjeWdi5b3pFTNi6TkeD + ldI0mG4+sWyQ37s/AEvjs0J5emLjqIJ+ItnVa5cwlzmkeTc1T7czEvKKIgBij139 + 8AxEkLzrzF9r4JE= +X-Sasl-enc: FdJBzkkGbeNA5km8mjpwnw/kKFOkW8gpy3KfGU7uUcq4 1378573679 +Received: from localhost (unknown [97.125.94.9]) + by mail.messagingengine.com (Postfix) with ESMTPA id 8B75AC00E8A; + Sat, 7 Sep 2013 13:07:59 -0400 (EDT) +Date: Sat, 7 Sep 2013 10:07:57 -0700 +From: "Kevin J. McCarthy" +To: notmuch@notmuchmail.org +Subject: [PATCH v2 1/1] notmuch-mutt: Fix tagging issues +Message-ID: <20130907170757.GA407@zaogao.lan> +Mail-Followup-To: notmuch@notmuchmail.org, Tomi Ollila , + Stefano Zacchiroli +References: <20130906221520.GC4226@zaogao.lan> + + <20130907155748.GD4226@zaogao.lan> +MIME-Version: 1.0 +Content-Type: multipart/signed; micalg=pgp-sha256; + protocol="application/pgp-signature"; boundary="lrZ03NoBR/3+SXJZ" +Content-Disposition: inline +In-Reply-To: <20130907155748.GD4226@zaogao.lan> +OpenPGP: id=B6B1CD9613699FB8; + url=http://www.8t8.us/configs/13699FB8.asc.pubkey; preference=sign +User-Agent: Mutt/1.5.21 (2010-09-15) +Cc: Tomi Ollila , Stefano Zacchiroli +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: Sat, 07 Sep 2013 17:08:12 -0000 + + +--lrZ03NoBR/3+SXJZ +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +Content-Transfer-Encoding: quoted-printable + +This patch fixes three issues with "notmuch-mutt tag": + +1. The message_id was not shell quoted. + Thanks to Jason Miller for the bug report and patch. + +2. The tags passed into tag_action() were not being properly quoted. + The "join before shell_quote" was combining multiple tags into a + single argument to notmuch tag: '+one -two -three' instead of + '+one' '-two' '-three'. + +3. A "--" was added between the tags and search-term as shown in the + current notmuch-tag man page. + +Thanks to Tomi Ollila for suggesting the simple fix of using +the list form of system(), which bypasses the shell. +--- + contrib/notmuch-mutt/notmuch-mutt | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmu= +ch-mutt +index c69b35c..4969e4b 100755 +--- a/contrib/notmuch-mutt/notmuch-mutt ++++ b/contrib/notmuch-mutt/notmuch-mutt +@@ -113,9 +113,7 @@ sub tag_action(@) { + my $mid =3D get_message_id(); + defined $mid or die "notmuch-mutt: cannot find Message-Id, abort.\n"; +=20 +- system("notmuch tag " +- . shell_quote(join(' ', @_)) +- . " id:$mid"); ++ system("notmuch", "tag", @_, "--", "id:$mid"); + } +=20 + sub die_usage() { +--=20 +1.8.4.rc3 + + +--lrZ03NoBR/3+SXJZ +Content-Type: application/pgp-signature; name="signature.asc" +Content-Description: Digital signature + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.14 (GNU/Linux) + +iQEcBAEBCAAGBQJSK11tAAoJELaxzZYTaZ+4xyMH/1XSHxGqyNCZZlOaFyac9O2m +OwUkyFcPoXc7p8U6BzKXBuT5/ZFoLy9wlp8n46sMw8aJL4/LTR+Mn9E0P/RpAkSE +1pIPlQxFgQgnufOV3jwHZZz4DCWYJ5vAM8lZJhutbecG5RGhdhAGeqSyCNWUP2t1 +eIwhyNeYfAtVdnTPyntCe+NLb7V34cDiFsaBsO6egE/3FTI8/mGq2nQXSpOeZ15g ++6SwKnv3hRsTGGo5hdnfndhneAPEWkscMCId8G/5fBFzXkoY9YoolOS5HpF7RUxN +cbRKc3jnzLa5Epb4SJoUgMKyRLsB0axH1W+uK4Wl3LIjzi6Qk0Vr2dkbxmt1Anw= +=11PR +-----END PGP SIGNATURE----- + +--lrZ03NoBR/3+SXJZ-- -- 2.26.2