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 3B7CE6DE137A for ; Mon, 10 Oct 2016 12:13:55 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.536 X-Spam-Level: X-Spam-Status: No, score=0.536 tagged_above=-999 required=5 tests=[AWL=-0.116, SPF_NEUTRAL=0.652] 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 6jRjxsM3UkmO for ; Mon, 10 Oct 2016 12:13:54 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 5AC3C6DE1374 for ; Mon, 10 Oct 2016 12:13:54 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 9FDA110007F; Mon, 10 Oct 2016 22:14:43 +0300 (EEST) From: Tomi Ollila 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> User-Agent: Notmuch/0.23+16~g6d066d0 (https://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ 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:13:55 -0000 On Mon, Oct 10 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" > > 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. > > 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") > > Then the code could generate the shell command with appropriate > quoting. Actually it looks like (also by quick look) that the elisp code does not generate shell command with appropriate quoting, but first splits the line with (split-string-and-unquote fcc-header) (*) and then creates command line arguments based on that list... (*) line 235 in notmuch-maildir-fcc.el so, it could be somewhat trivial to allow fcc-header to be either string or list -- and in the latter case use something like you presented above=E2=80=A6 Tomi >=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. > > =C2=A0 =C2=A0 =C2=A0 Cheers! =C2=A0 Keith > > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch