From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 95C9B6DE137A for ; Mon, 10 Oct 2016 12:20:22 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.023 X-Spam-Level: X-Spam-Status: No, score=0.023 tagged_above=-999 required=5 tests=[AWL=-0.107, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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 qxPgvuDQQxzQ for ; Mon, 10 Oct 2016 12:20:20 -0700 (PDT) Received: from mail-qk0-f169.google.com (mail-qk0-f169.google.com [209.85.220.169]) by arlo.cworth.org (Postfix) with ESMTPS id 996B96DE1374 for ; Mon, 10 Oct 2016 12:20:20 -0700 (PDT) Received: by mail-qk0-f169.google.com with SMTP id z190so115763575qkc.2 for ; Mon, 10 Oct 2016 12:20:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=spzowh/hQYiEKEqRxlXN4UBTRy88K5+0Jf4ukCo8CeM=; b=lWX4nQkFw3Sl6uqR9Y/3iPyGTDIxbv3opTi/f+Ui/cjutrxUIywZyzzp3P9RQ8jTPt 2tA+RZAWZPU4+piEc2PTj+wdl9PG5dKf1IBs0MpWChC12fiKp4oHoR6K9DqAUOjQuV3L xM1cJ2OmoCttTFAWAZ/T/PqkYFEfov0CVDMqAr0sKzJmlNpYLdJVpn/kp8k0y1X8A6K7 6gEYzUa4K2joaOuap3Kfw+CQQaX0gcx2TlySeDFjloofztlG8ox0nsRU9Q93X+hx8vwr 0AtPAmftaB3s20TBC5DfsRI4iWUfm9djokqYJ1bfoyhVET077D/PVDhP/CmVzFWL1RX3 IZfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=spzowh/hQYiEKEqRxlXN4UBTRy88K5+0Jf4ukCo8CeM=; b=gxE/eaLqKhBazI6l1KuyBo6G2/b4Rce9DxU60g2UNRynHA8InPRkakTJqyXFrxNQtZ o9GgnRWR6CuP0uguechfKqAOVXuTR1G9o/LXBC9hBXuPQDUFeSrVwANXyPzzgt/SGapB uioCT91IWiNhssPZYxxpDoyz1W5l7FCNWgZaFWqVrNQpPUoMkrGWfmZNzpsgEIhinKRp g53JbpfYkw5KmHsgzIR+IxwqIR5Ntg5zukjYAZ/FlWGhM66VUgDNsSFr4R4/97lLMFdU vuDc25zKKsbdeAWPo9yfFUOSKl6dS8JIzsOr6hUFKcLToT4svFjKjkT+bgqYBGKdoaeg HI/A== X-Gm-Message-State: AA6/9RkiiJyNj0NjECRQ9C/WbJQAN+Ua3dLqx50jPT7IZuCZmyU4YJdag20du6VcgEiMug== X-Received: by 10.194.55.9 with SMTP id n9mr31499848wjp.208.1476127219523; Mon, 10 Oct 2016 12:20:19 -0700 (PDT) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id us3sm42437999wjb.32.2016.10.10.12.20.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Oct 2016 12:20:19 -0700 (PDT) From: Mark Walters To: Keith Amidon , notmuch@notmuchmail.org Subject: Re: notmuch-insert Fcc handling w/spaces in dir name In-Reply-To: <1476123439.3172.12.camel@picnicpark.org> References: <1476123439.3172.12.camel@picnicpark.org> Date: Mon, 10 Oct 2016 20:20:17 +0100 Message-ID: <87oa2sau4u.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 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: Mon, 10 Oct 2016 19:20:22 -0000 On Mon, 10 Oct 2016, Keith Amidon wrote: > I just upgraded to 0.23 and tried out the Fcc handling using notmuch- > insert. =C2=A0I think this is a significant improvement and I'm excited to > use it. =C2=A0 I have it working successfully for my use case now, but it > did require one workaround that I didn't expect and that seems somewhat > fragile. > > The issue is that I'm synchronizing with Gmail and I'd like my sent > mail to be synchronized too. =C2=A0Therefore I have to insert into the > directory Gmail expects, which is "[Gmail]/Sent Mail". =C2=A0Notice the > space in the directory name. > > I was able to make this work by setting notmuch-fcc-dirs to: > > =C2=A0 =C2=A0"\"[Gmail]/Sent Mail\" +sent -inbox -unread" That is correct and this should probably be documented. > This works because the Fcc handling constructs a shell command to run > by just appending the notmuch-fcc-dirs value to (in the simple case) > "notmuch-insert --folder=3D", so the extra double quotes in my notmuch- > fcc-dirs value quote things appropriately at the shell level. I don't think this is correct. I think the fcc line gets split using split-string-and-unquote and passes the arguments to notmuch insert using call-process; I don't think it goes via shell. > While this works, depending on passing through shell quoting seems very > fragile. =C2=A0Changes in the implementation could break this solution > without it being obvious why. =C2=A0It seems like it would be better if t= he > notmuch-fcc-dirs value could be something like: > > =C2=A0 =C2=A0 ("[Gmail]/Sent Mail" "+sent" "-inbox" "-unread") This is possible. However, in the current form it is possible for the user to edit the fcc header before sending, and that has to be a string. Now, we could do as you suggest, and use combine-and-quote-strings to make the fcc header. Note, it is going to make things pretty complex if we still want to allow the folder to specified based on the from address. > Then the code could generate the shell command with appropriate > quoting. =C2=A0I took a quick look at implementing this but it looked more > complicated then I had time to invested right now. =C2=A0I thought it wou= ld > be good to get the issue out for discussion ASAP since this new > functionality was just released. Thanks: yes if we want to do the above it should be soon. Best wishes Mark