On Monday May 19 2025, 'jman' via mu-discuss wrote:
> "Dirk-Jan C. Binnema" <
dj...@djcbsoftware.nl> writes:
>
>> mu doesn't support searching arbitrary mail headers, such as those
>> github ones; however, you could do something with some other program
>> like procmail (and perhaps maildrop?) to turn these fields into tags
>> ("X-Label:", ""X-Keywords:") which mu does support.
>
> thanks for the tip. Luckily I have my own Postfix and I could add a few
> Sieve rules to add custom headers server-side.
>
> So, for reference and clarification:
> - The "X-priority" header can be filtered with "prio:"
> - The "X-Label" and "X-Keywords" headers can be filtered with "tags:"
>
> (though I couldn't find an explicit mention of the latter in the documentation or man 7 mu-query)
> Just to understand the context better: how complicated would it be to
> teach mu to search /any/ X-custom header? Would it make the size of the
> search index explode?
The index size is no issue, but the indexing code only supports a number
of predefined headers; and the rest of the code (such as the query
handling) depends on this as well. I guess its a consequence of how
Xapian works. No plans to change that.
I must admit the github labels looked useful though.
> Two notes, for the occasional reader:
> - maildrop does not have anything to edit emails (injecting headers for example)
> - procmail is IIUC outdated and basically abandoned, its use is discouraged
I've been using procmail for the last 20 years of so, it works fine :-).