unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: mbw+nm@mailbox.org
To: notmuch@notmuchmail.org
Subject: Questions regarding headers that may occur multiple times
Date: Fri, 11 Feb 2022 09:16:19 +0100	[thread overview]
Message-ID: <20220211081619.wfpduunaoe2fnfub@legion.localdomain> (raw)

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 <mbw+nm@mailbox.org>; 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 <mbw+nm@mailbox.org>; 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

             reply	other threads:[~2022-02-11 12:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-11  8:16 mbw+nm [this message]
2022-02-12 12:48 ` Questions regarding headers that may occur multiple times David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220211081619.wfpduunaoe2fnfub@legion.localdomain \
    --to=mbw+nm@mailbox.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).