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

Kevin J. McCarthy kevin at 8t8.us
Fri Apr 27 19:09:32 UTC 2018

On Fri, Apr 27, 2018 at 11:05:28AM -0700, Ammon Riley wrote:
> On Thu, Apr 26, 2018 at 7:57 PM, Kevin J. McCarthy <kevin at 8t8.us> wrote:
> > 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.

It could be.  One of the limitations of Mutt is that it downloads
everything when pulling a message down.  That's on the TODO list because
it could theoretically allow attachments on demand.  However, this is
much more complicated then it appears because of a variety of issues
with how Mutt works.

> 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.

No, mutt_read_rfc822_header() is dealing with the email header.  The
IMAP server is only returning a content-type for the email header, not
the various parts.

Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.mutt.org/pipermail/mutt-dev/attachments/20180427/3c729f42/attachment.asc>

More information about the Mutt-dev mailing list