Searching for mails with message id inside a folder

David Bremner david at tethera.net
Sat Nov 16 08:51:42 PST 2019


David Pérez <hallaplay835 at gmail.com> writes:

> $ notmuch search --output=files
> mid:"LNXP265MB007373FECCE2D877CC7EC241E6930 at LNXP265MB0073.GBRP265.PROD.OUTLOOK.COM"
> /home/david/.local/share/mail/hallaplay835/[Gmail].Important/cur/1571157038.24170_6.aerios,U=36835:2,S
> /home/david/.local/share/mail/hallaplay835/INBOX/cur/1571157004.24170_2.aerios,U=1199:2,S
> /home/david/.local/share/mail/hallaplay835/Ox/cur/1571157024.24170_4.aerios,U=2618:2,S
>
> I'd like to only match the one in INBOX. However,

See below for why this is hard to do directly with notmuch.

>
> $ notmuch search --output=files
> mid:"LNXP265MB007373FECCE2D877CC7EC241E6930 at LNXP265MB0073.GBRP265.PROD.OUTLOOK.COM"
> folder:"INBOX"

I guess this should maybe be folder:hallaplay835/INBOX, based on the
next search.

> returns no results. On the contrary,
>
> $ notmuch search --output=files
> mid:"LNXP265MB007373FECCE2D877CC7EC241E6930 at LNXP265MB0073.GBRP265.PROD.OUTLOOK.COM"
> path:"hallaplay835/INBOX/**"
>
> returns all three, when I believe that both should return only one
> result.

Notmuch doesn't really distinguish between files with the same message
id at the query level. Each database "mail message" has message-id as a
primary key (unique term in xapian language) and an attached list of
files.


More information about the notmuch mailing list