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 2C16F6DE136D for ; Mon, 10 Oct 2016 11:24:28 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.855 X-Spam-Level: X-Spam-Status: No, score=0.855 tagged_above=-999 required=5 tests=[AWL=0.865, T_RP_MATCHES_RCVD=-0.01] 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 r44O8KLg8_ME for ; Mon, 10 Oct 2016 11:24:26 -0700 (PDT) X-Greylist: delayed 401 seconds by postgrey-1.35 at arlo; Mon, 10 Oct 2016 11:24:26 PDT Received: from picnicpark.org (picnicpark.org [130.94.181.238]) by arlo.cworth.org (Postfix) with ESMTP id 272296DE133F for ; Mon, 10 Oct 2016 11:24:26 -0700 (PDT) Received: (qmail 88305 invoked by uid 13806); 10 Oct 2016 18:17:45 -0000 Received: from unknown (HELO gw.picnicpark.org) (camalot@[108.225.17.54]) (envelope-sender ) by 130.94.181.238 (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 10 Oct 2016 18:17:45 -0000 Received: from kea-tablet.picnicpark.org (gw.picnicpark.org [127.0.0.1]) by gw.picnicpark.org (Postfix) with ESMTPSA id 94E7112A02FE for ; Mon, 10 Oct 2016 11:17:37 -0700 (PDT) Message-ID: <1476123439.3172.12.camel@picnicpark.org> Subject: notmuch-insert Fcc handling w/spaces in dir name From: Keith Amidon To: notmuch@notmuchmail.org Date: Mon, 10 Oct 2016 11:17:19 -0700 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit 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 18:24:28 -0000 I just upgraded to 0.23 and tried out the Fcc handling using notmuch- insert.  I think this is a significant improvement and I'm excited to use it.   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.  Therefore I have to insert into the directory Gmail expects, which is "[Gmail]/Sent Mail".  Notice the space in the directory name. I was able to make this work by setting notmuch-fcc-dirs to:    "\"[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=", 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.  Changes in the implementation could break this solution without it being obvious why.  It seems like it would be better if the notmuch-fcc-dirs value could be something like:     ("[Gmail]/Sent Mail" "+sent" "-inbox" "-unread") Then the code could generate the shell command with appropriate quoting.  I took a quick look at implementing this but it looked more complicated then I had time to invested right now.  I thought it would be good to get the issue out for discussion ASAP since this new functionality was just released.       Cheers!   Keith