From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YFkNL0JTBmKWQQEAgWs5BA (envelope-from ) for ; Fri, 11 Feb 2022 13:14:58 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id iBKELEJTBmJ3jgAA9RJhRA (envelope-from ) for ; Fri, 11 Feb 2022 13:14:58 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (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 92B0916A3B for ; Fri, 11 Feb 2022 13:14:57 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 5038B5F71D; Fri, 11 Feb 2022 12:14:55 +0000 (UTC) X-Greylist: delayed 396 seconds by postgrey-1.36 at yantan; Fri, 11 Feb 2022 08:23:04 UTC Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [IPv6:2001:67c:2050::465:101]) by mail.notmuchmail.org (Postfix) with ESMTPS id DFCEA5F700 for ; Fri, 11 Feb 2022 08:23:04 +0000 (UTC) Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:105:465:1:3:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4Jw5zv5GwVz9sTg for ; Fri, 11 Feb 2022 09:16:27 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1644567385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=Ni9ocIZu5wpy0NJIt5DEwaRlecElV83+VOgZdkkEVfg=; b=mHrGyn1ZExrbw4F4wqN1rsLBW4rJobWmL+GHyTJqrrZcGiIfWCR+dKd+3k+U0ZZkFi5XQn RSi657/g7ujndCrymfx6H6D87dN0Vh5/YVwtRTnf1eosmCZQWjdzwl/rwDHBbbtjHFeFyQ RZX47lefgy0mwqjFNNNWjDFEYYUATcHs1wtRarAF01oE42eyeQZpUy3DHV+YaTPAfQdx1N QrM0wd2ecrtuKi5wdqUsVpU2v4GQ+EHzwMbgJzbT5T+2z/FVT6rHCQYcKzAvYfe4458AUS GuXwJx5MWaYsRzfokdKA4xZ3ylv1rBCTaU+CvG2KZFodZoVcBXK3dY5ZSJKR7w== Date: Fri, 11 Feb 2022 09:16:19 +0100 From: mbw+nm@mailbox.org To: notmuch@notmuchmail.org Subject: Questions regarding headers that may occur multiple times Message-ID: <20220211081619.wfpduunaoe2fnfub@legion.localdomain> MIME-Version: 1.0 Content-Disposition: inline X-MailFrom: maximilian.winkler@mailbox.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0 Message-ID-Hash: T333WZOOPMPMAGZC2S3DJK2C3ZM325J4 X-Message-ID-Hash: T333WZOOPMPMAGZC2S3DJK2C3ZM325J4 X-Mailman-Approved-At: Fri, 11 Feb 2022 12:14:53 +0000 X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644581698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=zgnFDF5+IVEExwi11L8WZt0Clh2zeqNhSJkV4Q9bLng=; b=cQOrzWjThp+AONwVA7vkxAX7rcjkQx5aXjg3WJ8zzF95N8PjgQURq21C3fVcYxkLNjHrQa qlM0HRUKX6/bqyncQTQIpZOoK5RZ3j8WwDDXVI5PyRAA4mTsO/d6+aifNGq5V163w5BRBX k8fL+2DSFN1TlKI/1MoWC1vQ+/ETbqkv0f01RKche1VLi0sgzCUEt7M7ckUstiiMzn1IQ7 fcwNlQL47ncKmNVzf5kxzwx9rmdnutD3OvzOv3O8oBdMAjpbgw7ZGBom2GKJ2k41tV4gow WHfT5s48Sql/FTdBD0V9c5JwPOs3oYo8cgqDHOZeaa/ufUXcuG6WwGY0mc8D9w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644581698; a=rsa-sha256; cv=none; b=l5lGUhFCg80dYtLcnEzSembEOFWmhJv3msL4iz8dpYZR1zrs7K8vmgA7FpPetCKjjSVgj6 68aFrfP34fR/nEXNU4TIVioQTI/ZBVgzT4YFK9/K54q02D3cgYrmJwdg5k2sdxYkMTXyaY 5Y/01P5TSoVPo+ROwS+m7GHYQY6gnJ0ZoGyB6rbjGECD6RDwsJj0dIjMRlqoylK0l5oirz qWAXhPumxM4wq9OyNh+2D1t3FOpKNcsqnhg8WZO9yUfLkhv8ohIx1rKz4+UcHBCSJWdoPQ KZHQA1eqNz11Z1sBrHAF3fKopDFEEfHkw+KWXEWeif79P9/Mh2QY5HPux7MsBA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=mailbox.org header.s=mail20150812 header.b=mHrGyn1Z; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mailbox.org (policy=reject); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 6.00 X-Spam: Yes Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=mailbox.org header.s=mail20150812 header.b=mHrGyn1Z; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mailbox.org (policy=reject); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 92B0916A3B X-Spam-Score: 6.00 X-Migadu-Spam: Yes X-Migadu-Scanner: scn0.migadu.com X-TUID: QiPbJLF8Y+e1 Hi there, I have been using notmuch in conjunction with neomutt and some homemade tagging scripts more or less successfully for about two years now. However, sometimes I have difficulties to uniquely identify (and thus tag accordingly) the intended recipient of an email. For that I wanted to try to use the `Delivered-To` and `Received:` headers. These may occur an arbitrary amount of times within a given email. But from what I gather by first reindexing with `$ notmuch config set index.header.Received Received` `$ notmuch reindex '*'` and then inspecting the result via `$ notmuch config set show.extra_headers="received;delivered-to" `$ notmuch show --format=json date:today | jq`, it appears that only the first occurrence of these header values are taken into account? I might be wrong, so I'll just try to describe what problem I am trying to solve: Consider an email that looks like this: Return-Path: <0101017ee5317599-02f47ee2-4eda-4840-abbd-7d52b54ff13b-000000@us-west-2.amazonses.com> Delivered-To: unknown Received: from pop3.mailbox.org ([2001:67c:2050:106::143:199]:995) by legion.localdomain with POP3-SSL getmail6 msgid:UID12422-1430074968; 10 Feb 2022 20:27:40 -0000 Delivered-To: mbw+nm@mailbox.org Received: from director-05.heinlein-hosting.de ([80.241.60.215]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by dobby23a.heinlein-hosting.de with LMTPS id 2GLdD/RsBWLLYwEAwSxZKQ (envelope-from <0101017ee5317599-02f47ee2-4eda-4840-abbd-7d52b54ff13b-000000@us-west-2.amazonses.com>) for ; Thu, 10 Feb 2022 20:52:20 +0100 Received: from mx2.mailbox.org ([80.241.60.215]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by director-05.heinlein-hosting.de with LMTPS id +M7kDfRsBWJYZAEATazItQ (envelope-from <0101017ee5317599-02f47ee2-4eda-4840-abbd-7d52b54ff13b-000000@us-west-2.amazonses.com>) for ; Thu, 10 Feb 2022 20:52:20 +0100 X-Virus-Scanned: amavisd-new at heinlein-support.de etc. Here, the information visible with `notmuch show` includes `Received: from pop3.mailbox.org` (good) and `Delivered-To: unknown` (bad). What I would like to do is to somehow access the second (or maybe all) occurrences of these header values. Is that possible? This would allow me to identify emails which `To: all@some-mailing-list.net`. It also appears that (with notmuch 0.35), the `extra_headers` only show up with `--format.json`, by the way. I'd be grateful for any suggestions on how to approach this. Cheers, Max