From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0OoeDTutd2CxQwEAgWs5BA (envelope-from ) for ; Thu, 15 Apr 2021 05:04:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id qLTdBjutd2CSaAAAbx9fmQ (envelope-from ) for ; Thu, 15 Apr 2021 03:04:27 +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) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C2F8D160DA for ; Thu, 15 Apr 2021 05:04:24 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 4BD7226876; Wed, 14 Apr 2021 23:03:41 -0400 (EDT) X-Greylist: delayed 1045 seconds by postgrey-1.36 at nmbug; Wed, 14 Apr 2021 23:03:36 EDT Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by mail.notmuchmail.org (Postfix) with ESMTPS id B2BDE1FBCD for ; Wed, 14 Apr 2021 23:03:36 -0400 (EDT) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A9BCFAFEB; Thu, 15 Apr 2021 02:46:08 +0000 (UTC) From: NeilBrown To: Tomi Ollila , David Bremner , Firmin Martin , notmuch@notmuchmail.org Date: Thu, 15 Apr 2021 12:46:02 +1000 Subject: Re: Query emails sent to undisclosed-recipients In-Reply-To: References: <875z1iauay.fsf@Inspiron.i-did-not-set--mail-host-address--so-tickle-me> <87o8f9pt72.fsf@tethera.net> Message-ID: <87wnt42rkl.fsf@notabene.neil.brown.name> MIME-Version: 1.0 Message-ID-Hash: HDUY4M2ZQX3233X3VHPXPITN7MQ56NRU X-Message-ID-Hash: HDUY4M2ZQX3233X3VHPXPITN7MQ56NRU X-MailFrom: neil@brown.name 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 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: multipart/mixed; boundary="===============3444054615009066792==" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618455866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=iVf+odE26QhZgUFjz0RIuLM+3NN3sBqQSaOOR0LnZqM=; b=uE2YMV23kKfiBCYIKFN0h6uuXb6FmU2PRvzW1I+mqMx2GEXajHj3pusPNzCxKUOSRBe5W3 N/ADWZAC5GTR0Xn0TsHBbcvQnInIvRQuxGwIq+B7FVq1Rl3P2KWke5LUsDUzSHlQ0o7gmc Myiu+eNDsarUTLii7s9up1Lyhm2FH0vE2Zsy53PJZGlqRllpTQk/EoN9LOXCEeJmCAEoJU Pz38wGOfIQDm2Wtn77CV+w5SGM8KDtro9ply+KPZso+yfT43k26LLUzwF4JROek9yoO+rU VsxjG/1GIpfzigTsRvOQkt22Lb4NncSK9uFhI+Ldy90mcY5O6DVE7FgQSr9dLw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618455866; a=rsa-sha256; cv=none; b=MVao/FPn2joqN27g7ZC9Uj4hRShhlBRFpjs83StxzAxAOCcna8kn/Kw/Wmapy/xyF3UpK+ bEJofMjWE/1pBuE0H3M23RVQeXoF7t4pHWbtz8yY1bDi1O7SFlW+8IP0eILUelhjiXH2A4 opmO8tuVG9yhtboMVIJQYn8k5a/l2jT1+N0+PvBicWdqjmoZY2UwasnKL/DQ+4gfo5TjH8 0Z92B2em8DR5yv1E+CvdoTJK0ALzNIUPey3Iv7N82je5pLio3UF/vnCaeNbtmtnlPStazo WN8C47qZQxMkU9RB1h3S+YJ894keKS4nRqOT9CeawXoOfyyIpgsHxMeSZ8+HHQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; 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-Migadu-Spam-Score: -2.50 Authentication-Results: aspmx1.migadu.com; dkim=none; 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-Migadu-Queue-Id: C2F8D160DA X-Spam-Score: -2.50 X-Migadu-Scanner: scn0.migadu.com X-TUID: SgBg1uFQK1/B --===============3444054615009066792== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, Mar 23 2021, Tomi Ollila wrote: > On Tue, Mar 23 2021, David Bremner wrote: > >> Tomi Ollila writes: >> >>> On Tue, Mar 23 2021, Firmin Martin wrote: >>> >>>> Hi, >>>> >>>> I have emails whose the "To" field is undisclosed recipients. In JSON: >>>> >>>> ``` >>>> "To": "undisclosed-recipients: ;" >>>> ``` >>>> >>>> I would want to tag such email as spam, but I can't query them >>>> using=20 >>>> >>>> ``` >>>> notmuch show --format=3Djson to:"undisclosed-recipients: ;" >>>> ``` >>>> >>>> or any variation (regex etc.). >>>> >>>> This question has already been addressed in 2013 [1]. Are there any pl= an >>>> to implement this feature or available workaround ? >>> >>> Tried. many things. did not work. notmuch-search-terms(7) tells >>> >>> to: >>> >>> (so no regex syntax...) >>> >>> I don't know why that doesn't work. IIRC no plan, but patches welcome >= ;D >> >> The (light) technical background is that regex syntax in notmuch >> requires value slots, and someone (TM) would need to evaluate how much >> adding a value slot for to: would cost in terms of database size / speed >> of queries. >> >> I think there's a separate question about address groups being ignored, >> discussed in the linked thread. > > But the question if why doesn't to:undisclosed-recipients: > or to:undisclosed-recipients work Because "undisclosed-recipient:" is not an address or a comment (in RFC822 / RFC5322 syntax). It is a label (a name for a group of addresses). It is not syntactically valid to have an empty "to:" field, or to have no "to:" field. The only valid syntax which doesn't actually give any address is "label:;". These messages don't actually have any "to" address. So notmuch search "not to:*" should work... except that it doesn't. notmuch search --output=3Dfiles "not (to:a* OR to:b* OR to:c* OR to:d* \ OR to:e* OR to:f* OR to:g* OR to:h* OR to:i* OR to:j* OR to:k* \ OR \to:l* OR to:m* OR to:n* OR to:o* OR to:p* OR to:q* OR to:r* \ OR to:s* OR to:t* OR to:u* OR to:v* OR to:w* OR to:x* OR to:y* OR to:z*= )" does work (as long as no addressed start with a non-alpha character). I piped the above in xargs grep -i '^to:' | grep -v -i ': *;' Some of the matches had an empty 'to:' which is syntactically invalid. Others had "<>" as the address. I don't think this is legal, but I've seen it used in Return-path: a lot. RFC5322 doesn't mention it. The rest was in the noise. NeilBrown --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJEBAEBCAAuFiEEG8Yp69OQ2HB7X0l6Oeye3VZigbkFAmB3qOsQHG5laWxAYnJv d24ubmFtZQAKCRA57J7dVmKBuZIYD/9076wPw/NX3oqRfZk3mXAE4tqZ4vdHVGyY eJ6HfjMVmUMGiFomxTPcrdz9hpuNVkMo4bpq+uNzQZN3OFDq2plPkz9skz28w4/e MRYA3agayXH/FLhldRG1xTj9SmE63j5WSzcQ/eweuUnfVDl0S1Zj9WUbrJ85+SQF A2SUytk+d/XUM+p2Bjw4f5vZUbey6r5g9pZJQpJlNct+Hqmc5z3thVqaM/sGm7VZ n4i0IMdo/6IU2RfgUDMqimXzqEKFic4UaK9/eZnbE2PRbvA+T3JHG9Osxm1UZF4l aOERDcwHdZTuONhOUKlxSp1jHGopv2S3XfWsZuoPFBqvZb6NV6L2l6sMX6JOuTCr Ry/56uroWFCqFXCcU5Gk4wJbkcHFI19GbHomemsS8/ydaxjLLxuobinishRYPC55 yi2vR2ETeCPk1MGUR/eni3IF/Aun8bdzWwE55XfY4zZKcMmtWK2239Gw1UoRBQ5D uZzfgh+fyVTXAkQ0J+7yQSn+9tlXIUdWoJrsYCPLtB2CVqB0NiyUnXN2UAiBAIDG swWgM2PFlhBCdZl7xx5bbsvvd+Qzd41iwNplNoz02qulNNtgUIjKJKxFC0OXXJPA vY0k2esYxMCI6TSwzG9FtvtbmO+LZv2WPo67QnSXNxwbd30aGvBDOExQJqolRWbV H6ex3yT29w== =//cI -----END PGP SIGNATURE----- --=-=-=-- --===============3444054615009066792== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============3444054615009066792==--