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 A96016DE138F for ; Sat, 11 Feb 2017 17:02:06 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.005 X-Spam-Level: X-Spam-Status: No, score=-0.005 tagged_above=-999 required=5 tests=[AWL=0.006, SPF_PASS=-0.001, 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 Ia3vbcxcbNpy for ; Sat, 11 Feb 2017 17:01:59 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id D2AF96DE1386 for ; Sat, 11 Feb 2017 17:01:58 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1cciXY-0002bg-N1 for notmuch@notmuchmail.org; Sat, 11 Feb 2017 20:01:20 -0500 Received: (nullmailer pid 17580 invoked by uid 1000); Sun, 12 Feb 2017 01:01:53 -0000 Resent-To: notmuch@notmuchmail.org Resent-From: David Bremner Resent-Date: Sat, 11 Feb 2017 21:01:53 -0400 Resent-Message-ID: <87k28wusqm.fsf@rocinante.cs.unb.ca> From: David Bremner To: Mark Walters Subject: Re: [Patch v4] lib: regexp matching in 'subject' and 'from' In-Reply-To: <878tpetpny.fsf@qmul.ac.uk> References: <20170121032752.6788-1-david@tethera.net> <20170121135917.22062-1-david@tethera.net> <87efzqef2r.fsf@tethera.net> <87ziia2jpj.fsf@nikula.org> <87efz8vz0w.fsf@rocinante.cs.unb.ca> <878tpetpny.fsf@qmul.ac.uk> Date: Sat, 11 Feb 2017 19:25:18 -0400 Message-ID: <87mvdsux7l.fsf@rocinante.cs.unb.ca> MIME-Version: 1.0 Content-Type: text/plain 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: Sun, 12 Feb 2017 01:02:06 -0000 Mark Walters writes: > > Hi > > Broadly I like the backslash escaping option. Two thoughts: can any > fields (from/subject/message-id) start with a "\" anyway? I think not > but thought it worth checking. >From and subject are probablistic xapian fields, so punctuation is essentially ignored by the query parser. That being said, nothing prevents subjects from starting with /. According to my reading of rfc5322, conforming message ids cannot contain any of '()<>[]:;@\,."' > Secondly, message-id is often round-tripped, that is output from notmuch > and then fed back to notmuch. Do we want to escape the output as above > before printing in any cases? My view is that if we output the > message-id prefixed with "id:" then we should escape it (which applies > with --output=messages --format=text), but if we don't print the "id:" > part then we shouldn't (eg with --format=json). A similar thing would > apply to emacs: if it is a normal stash then escape the id, but if it is > a "bare stash" then do not. Yes that sounds about right. Do we actually output from and subject with prefixes attached to them? I have the feeling not. > > Actually, one more thing: it would be a shame to block or significantly > delay the series for such a corner case. > If it's _only_ the output of notmuch search --output=messages, then I guess it's doable. d