From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id uKGwHcuzGV+kYAAA0tVLHw (envelope-from ) for ; Thu, 23 Jul 2020 15:59:07 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 2BuYGcuzGV/IWAAA1q6Kng (envelope-from ) for ; Thu, 23 Jul 2020 15:59:07 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 01BAB9404C7 for ; Thu, 23 Jul 2020 15:59:04 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id BF9311FA5A; Thu, 23 Jul 2020 11:58:52 -0400 (EDT) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) by mail.notmuchmail.org (Postfix) with ESMTPS id 319791F9C9 for ; Thu, 23 Jul 2020 11:58:49 -0400 (EDT) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 947D11B0041E; Thu, 23 Jul 2020 18:58:44 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1595519924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vBTclpydKdNGqVUHJgFhpWdXoHGXFSWq4EdJePyv2dc=; b=JQrqOv+nB3CyA49ccyg0UztmjLT2pTQD35Oqae9bsUmxuRD4MMYXo+rEwpy1rleRMXtKVi 1fGyDl1vM5kKZLwgARWKuk0Zx624G+hHIbJEE8hpMaZABVDLSYnNt/SPa+eV4M+6gLCNhY WMBXjrlOqG5wcIFfXdH20/J3ONFi0qR3DAKEaEt5mCeRrXjXd7KrJhg9PFpJAIgG9E2OWB zBfnRlEepFn1HQO08tqjzVEn1HvVSv2VMHRhZsRTP3P9ZMLJjdPXFR/7xjyRiR7NXUTDdz QvdKx1qBi8HrK56umWkMOZjW42EfFfzfAsUxKVOZTGbu2QJ1+H/iBx/XkNeerQ== From: Tomi Ollila To: , notmuch@notmuchmail.org Subject: Re: [Kevin McCarthy] Bug#966100: notmuch-mutt: symlinking now fails for indexed mailboxes with a space in the name In-Reply-To: <87eep2o90a.fsf@tethera.net> References: <159546998738.232977.10166967333633103899.reportbug@afu.lan> <87eep2o90a.fsf@tethera.net> User-Agent: Notmuch/0.30+12~g9f4381f (https://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1595519924; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vBTclpydKdNGqVUHJgFhpWdXoHGXFSWq4EdJePyv2dc=; b=AJxcajr155lpxs8SxoEkdAYAz6D68Vu1vP4264zpfgDrMl06OGpg07sLeTI60h6zAa1avI yTx5PlnVm+MJAEgFrrDPq5zF+lcTU3cEjaiKQcrD+XBr/14X3gQ8fN/40G1RZzIQ6Qa2Jn YHWsJdWFNpL+LXXWbOC7sBDX0/f0CUvqnvTJJ25iK5bN406Cwl5JlGNRd4WrefTQ5WY28q d2OzDVlvRs+cIDLdXS3XGjwLF8hK7hXfTsGK6yTqNtj6EoNEOYLv/BAg5TaeEEi2LsoEWq 4m0q7EOE2ww7VuaTedOnudDUMQKjgz4j30qeOVXbbdGAHG73To0BHUEoAIgWeA== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1595519924; a=rsa-sha256; cv=none; b=CCKzueeJ2qSpz4h+bbkf416FTKtyLL5fH/iBfGIGPSI7VR25X5wb6qxqpcr790G+gsFn2f ZqJGhl64WNMWTr7DAJlzfEyr9+/2AA7sLNIYGQGarClFPsy+4p9kgTqZZKAeZ78HZXrUgc nuxCJZFqCUnlvI3HPyNE3Z/bhm3KPXuX3eWjqcJztJXvfhqwWhFM/ok3gQXcht7J4FpzFt YCBltyw4rAq1PdPRUr6SdZHMbp2A//XrphF/xi4p7XrwPi2rjQz6bj0PMs/QUWVffik3pC 2oCh4Hb0vXvL+VzUMxuGGWVmZnm34X6aiA+x7pGxZn0lCvzCJGIjoVTvyDnTWg== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi Message-ID-Hash: 3S26QZJTVZVPDB244O7SM44HDLWCO6KX X-Message-ID-Hash: 3S26QZJTVZVPDB244O7SM44HDLWCO6KX X-MailFrom: tomi.ollila@iki.fi X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Stefano Zacchiroli X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=iki.fi header.s=lahtoruutu header.b=JQrqOv+n; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 3.53 X-TUID: Ngezcf0CXSvX On Thu, Jul 23 2020, David Bremner wrote: > From: Kevin McCarthy > Subject: Bug#966100: notmuch-mutt: symlinking now fails for indexed mailboxes with a space in the name > To: Debian Bug Tracking System > Date: Wed, 22 Jul 2020 19:06:27 -0700 > > Package: notmuch-mutt > Version: 0.30-1 > Severity: important > Tags: upstream > > Dear Maintainer, Hi Kevin, others. > > After recently updating from stable to testing, notmuch-mutt search > and thread commands stopped including results from my "Sent Items" > maildir folder. There are broken links in the results folder, and > symlink error messages in the terminal window after exiting mutt. > > I tracked this down to upstream commit > > but unfortunately my shell-fu is not good enough to understand exactly > why the new version isn't working. > > If I manually swap revert the diff then my Sent Items results start > working again. So somehow the backslash-escaping works for xargs but > not for the shell while/read loop. > > Here's the part of the commit above causing the breakage. > > - - - - - - - - - > diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmuch-mutt > index 0e46a8c1b95e76163eed68694aa5a1a973c8b371..d33223bdd88e776acf79ae8b4ba2703ff1e6cc58 100755 (executable) > --- a/contrib/notmuch-mutt/notmuch-mutt > +++ b/contrib/notmuch-mutt/notmuch-mutt > @@ -50,7 +50,7 @@ sub search($$$) { > empty_maildir($maildir); > system("notmuch search --output=files $dup_option $query" > . " | sed -e 's: :\\\\ :g'" > - . " | xargs -r -I searchoutput ln -s searchoutput $maildir/cur/"); > + . " | while IFS= read -r searchoutput; do ln -s \$searchoutput $maildir/cur/; done"); > } This could work, cannot test (compiles OK w/ perl -c when I outcommented packages I don't have. --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<-- diff --git a/contrib/notmuch-mutt/notmuch-mutt b/contrib/notmuch-mutt/notmuch-mutt index d33223bd..b6c2d7b5 100755 --- a/contrib/notmuch-mutt/notmuch-mutt +++ b/contrib/notmuch-mutt/notmuch-mutt @@ -12,6 +12,7 @@ use strict; use warnings; use File::Path; +use File::Basename; use Getopt::Long qw(:config no_getopt_compat); use Mail::Header; use Mail::Box::Maildir; @@ -41,16 +42,19 @@ sub search($$$) { my ($maildir, $remove_dups, $query) = @_; my $dup_option = ""; - $query = shell_quote($query); - + my @args = qw/notmuch search --output=files/; if ($remove_dups) { - $dup_option = "--duplicate=1"; + push @args, "--duplicate=1"; } + push @args, $query; empty_maildir($maildir); - system("notmuch search --output=files $dup_option $query" - . " | sed -e 's: :\\\\ :g'" - . " | while IFS= read -r searchoutput; do ln -s \$searchoutput $maildir/cur/; done"); + open my $p, '-|', @args or die "Running @args failed: $!\n"; + while (<$p>) { + chomp; + my $bn = basename $_; + symlink $_, "$maildir/cur/$bn"; # fixme: check (report?) error + } } sub prompt($$) { --8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<-- > > sub prompt($$) { > - - - - - - - - - > > > -- System Information: > Debian Release: bullseye/sid > APT prefers testing > APT policy: (500, 'testing') > Architecture: amd64 (x86_64) > > Kernel: Linux 5.7.0-1-amd64 (SMP w/16 CPU threads) > Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set > Shell: /bin/sh linked to /bin/dash > Init: systemd (via /run/systemd/system) > LSM: AppArmor: enabled > > Versions of packages notmuch-mutt depends on: > ii libmail-box-perl 3.008-1 > ii libmailtools-perl 2.21-1 > ii libstring-shellquote-perl 1.04-1 > ii libterm-readline-gnu-perl 1.36-2+b1 > ii notmuch 0.30-1 > ii perl 5.30.3-4 > > Versions of packages notmuch-mutt recommends: > pn mutt > > notmuch-mutt suggests no packages. > > -- no debconf information