From b10c6df30e8671450a897884488ec40ca7572865 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sun, 31 May 2015 02:42:01 +0200 Subject: [PATCH] Re: bug report: Emacs notmuch-mode fails attachments with spaces --- 02/ebebc14e941e9296513cb513e28d54f52476d7 | 164 ++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 02/ebebc14e941e9296513cb513e28d54f52476d7 diff --git a/02/ebebc14e941e9296513cb513e28d54f52476d7 b/02/ebebc14e941e9296513cb513e28d54f52476d7 new file mode 100644 index 000000000..4750c68fd --- /dev/null +++ b/02/ebebc14e941e9296513cb513e28d54f52476d7 @@ -0,0 +1,164 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 0FE056DE1638 + for ; Sat, 30 May 2015 18:01:45 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -0.722 +X-Spam-Level: +X-Spam-Status: No, score=-0.722 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, + RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] + autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id byOc80PpqNaL for ; + Sat, 30 May 2015 18:01:39 -0700 (PDT) +X-Greylist: delayed 1156 seconds by postgrey-1.35 at arlo; + Sat, 30 May 2015 18:01:39 PDT +Received: from mail.tiggerswelt.net (mail.tiggerswelt.net [94.186.151.130]) + by arlo.cworth.org (Postfix) with ESMTPS id 300F56DE119C + for ; Sat, 30 May 2015 18:01:39 -0700 (PDT) +Received: from localhost (f053141102.adsl.alicedsl.de [78.53.141.102]) + (using TLSv1 with cipher AES128-SHA (128/128 bits)) + (No client certificate requested) + by mail.tiggerswelt.net (Postfix) with ESMTP id 03CFC2900; + Sun, 31 May 2015 02:46:18 +0200 (CEST) +From: Nils Dagsson Moskopp +To: David Edmondson , Tomi Ollila , + notmuch@notmuchmail.org +Subject: Re: bug report: Emacs notmuch-mode fails attachments with spaces +In-Reply-To: +References: <87twyurc78.fsf@dieweltistgarnichtso.net> + <8761b9pu11.fsf@dieweltistgarnichtso.net> + +User-Agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/23.4.1 + (i486-pc-linux-gnu) +Date: Sun, 31 May 2015 02:42:01 +0200 +Message-ID: <87zj4lbmsm.fsf@dieweltistgarnichtso.net> +MIME-Version: 1.0 +Content-Type: multipart/signed; boundary="=-=-="; + micalg=pgp-sha256; protocol="application/pgp-signature" +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +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: Sun, 31 May 2015 01:01:45 -0000 + +--=-=-= +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: quoted-printable + +David Edmondson writes: + +> On Tue, Feb 10 2015, Nils Dagsson Moskopp wrote: +>> Tomi Ollila writes: +>> +>>> On Mon, Feb 09 2015, Nils Dagsson Moskopp wrote: +>>> +>>>> Dear notmuch developers, +>>>> +>>>> +>>>> I use notmuch-mode for GNU Emacs for managing my email. +>>>> +>>>> I think I have found a bug in notmuch-mode: If I do =E2=80=9C.-v=E2=80= +=9D on the line =E2=80=9C[ +>>>> 2015 _ Richtlinien.pdf: application/pdf ]=E2=80=9D, then notmuch will = +open three +>>>> windows of zathura (the PDF viewer I use). +>>>> +>>>> It seems to me that someone here either forgot quoting or decided to +>>>> split filenames on spaces. I suggest that =E2=80=9C2015 _ Richtlinien.= +pdf: +>>>> application/pdf=E2=80=9D should be quoted in notmuch-show-view-part. +>>>> +>>>> Note that saving attachment (=E2=80=9C.-s=E2=80=9D, notmuch-show-save-= +part) generally +>>>> works even if the attachment file names have spaces. In case it matter= +s, +>>>> I normally use the rc(1) shell in Debian . +>>> +>>> This code handles the saving and displaying in question (quick look hop= + i +>>> am right :) +>>> +>>> 2282 (defun notmuch-show-save-part () +>>> 2283 "Save the MIME part containing point to a file." +>>> 2284 (interactive) +>>> 2285 (notmuch-show-apply-to-current-part-handle #'mm-save-part)) +>>> 2286=20 +>>> 2287 (defun notmuch-show-view-part () +>>> 2288 "View the MIME part containing point in an external viewer." +>>> 2289 (interactive) +>>> 2290 ;; Set mm-inlined-types to nil to force an external viewer +>>> 2291 (let ((mm-inlined-types nil)) +>>> 2292 (notmuch-show-apply-to-current-part-handle #'mm-display-par= +t))) +>>> +>>> SO, there is 2 options: +>>> +>>> 1) mm executes save part correctly but not display part +>> +>> It seems I cannot investigate this with my knowledge, as =E2=80=9CM-x +>> find-function RET mm-display-part=E2=80=9D gives =E2=80=9CCan't find lib= +rary +>> /usr/share/emacs/23.4/lisp/gnus/mm-decode.el=E2=80=9D. Any ideas? +>> +>>> 2) there is (shell) wrapper program executing zathura which cannot hand= +le +>>> arguments with spaces (there is plenty of examples of this!) +>>> +>>> +>>> You could try to check how th external processes are executed by execut= +ing: +>>> +>>> strace -f -e trace=3Dprocess emacs -f notmuch +>>> +>>> (emacs on X is preferable in this case ;) +>> +>> Thank you for that suggestion. It seems that there does happen both some +>> (wrong) escaping and splitting at spaces. I can see the following trace: +>> +>> --- snib --- +>> execve("/usr/bin/zathura", ["/usr/bin/zathura", "/tmp/emm.23178ut2/2015\= +\", "_\\", "Richtlinien.pdf"] [/* 51 vars */]) =3D 0 +>> --- snab --- +>> +>> Somewhat unusually, it is preceeded by an invocation of the shell: +>> +>> --- sneb --- +>> execve("/usr/bin/rc", ["/usr/bin/rc", "-c", "/usr/bin/zathura /tmp/emm.2= +3178u"...], [/* 51 vars */] +> +> It would be useful to see the rest of this string ^^. Can you persuade +> strace to show more please? + +I have no idea how. Do you? + +=2D-=20 +Nils Dagsson Moskopp // erlehmann + + +--=-=-= +Content-Type: application/pgp-signature + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1 + +iF4EAREIAAYFAlVqWNkACgkQZGjbY/Ag5QlhYwEAgzdhGhNqr9NbD23t/wWp2wQS +Id4TvJlxg79cmYVkSfkBAKxXM0FBfKNLxCJ97ltJ6kYN9Nvnk5yXoQec8Ccv3Vj2 +=FJJZ +-----END PGP SIGNATURE----- +--=-=-=-- -- 2.26.2