<<< Date Index >>>     <<< Thread Index >>>

Re: mutt/316: Indicate in the Index if a file has attachments



On Sun, Aug 07, 2005 at 06:04:40PM -0500, David Champion wrote:
> IIRC, it's possible to get IMAP to return a parsed-out representation of
> the MIME structure.  I don't recall how, but it seems vaguely familiar.
> It would be a nice feature add for a later version of the patch.  But a
> message parse is still going to be needed for local messages, so I think
> Thomas's objection is still in play.

You are thinking of the BODYSTRUCTURE specifier to the IMAP FETCH command.  

The response looks like this:
A FETCH 5 (BODYSTRUCTURE)
* 5 FETCH (BODYSTRUCTURE (("TEXT" "PLAIN" ("CHARSET" "US-ASCII" "FORMAT" 
"flowed") NIL NIL "7BIT" 225 5 NIL NIL NIL)("APPLICATION" "PDF" 
("X-UNIX-MODE" "0644" "NAME" "slides.pdf") NIL NIL "BASE64" 317260 NIL 
("INLINE" ("FILENAME" "slides.pdf")) NIL)("TEXT" "PLAIN" ("CHARSET" 
"US-ASCII" "FORMAT" "flowed") NIL NIL "7BIT" 254 11 NIL NIL NIL) "MIXED" 
("BOUNDARY" "Apple-Mail-16-775817061") NIL NIL))

which mutt displays as:
I     1 <no description>                 [text/plain, 7bit, us-ascii, 0.2K]
I     2 slides.pdf                              [applica/pdf, base64, 305K]
I     3 <no description>                 [text/plain, 7bit, us-ascii, 0.2K]

If you do write code that parses BODYSTRUCTURE, it might also allow mutt to
display the existence of attachments without downloading them until
requested.

Nathan