[PATCH] Add ~M pattern to match mime Content-Types.

Ammon Riley ammon.riley at gmail.com
Fri Apr 27 18:05:28 UTC 2018

On Thu, Apr 26, 2018 at 7:57 PM, Kevin J. McCarthy <kevin at 8t8.us> wrote:
> On Thu, Apr 26, 2018 at 06:00:00PM -0700, Ammon Riley wrote:
>> 3rd time's the charm, right?
> I think so - this version looks good.  I'll give a few days for others
> to chime in.
> There don't appear to be any applicable IMAP SEARCH extensions for this
> pattern.  I suppose we could fetch BODYSTRUCTURE, and use that, but
> since we don't currently fetch/parse that in Mutt, it would be a large
> amount of work for a one-off search feature.  I don't know that it's
> worth it.

I see that imap/TODO mentions using BODYSTRUCTURE in the
view-attachments menu.  So it seems like if the work were done, it
could be used in more than one place.

However, looking at imap_read_headers(), I see that it fetches the
Content-Type header.  There's a comment near the bottom that
reads "content built as a side-effect of mutt_read_rfc822_header",
which does indeed parse Content-Type headers, and builds the
part structure.  It's not clear to me if the IMAP server returns *all*
of the Content-Type headers.  If so, it seems like we already have
all of the same info that requesting BODYSTRUCTURE would
give us, and ~M won't pull the full body of the email locally.
Perhaps someone can clarify that?  If I get the chance, I'll
try and configure mutt to access an IMAP server and check...


More information about the Mutt-dev mailing list