imapserver: return all the extensible fields for bodystructure, notably for content-disposition

The gmail iOS/Android app were showing mime image parts as (garbled) text
instead of rendering them as image. By returning all the optional fields in the
bodystructure fetch attribute, the gmail app renders the image as expected by
the user. So we now add all fields. We didn't before, because we weren't
keeping track of Content-MD5, Content-Language and Content-Location header
fields, since they aren't that useful.

Messages in mailboxes have to be reparsed:
	./mox reparse

Without reparsing, imap responses will claim the extra fields
(content-disposition) are absent for existing messages, instead of not claiming
anything at all, which is what we did before.

Accounts and all/some mailboxes can get their "uid validity" bumped ("./mox
bumpuidvalidity $account [$mailbox]"), which should trigger clients to load all
messages from scratch, but gmail doesn't appear to notice, so it would be
better to remove & add the account in gmail.

For issue #327, also relevant to issue #217.
This commit is contained in:
Mechiel Lukkien
2025-04-05 15:46:17 +02:00
parent 69d2699961
commit 2defbce0bc
11 changed files with 185 additions and 65 deletions

View File

@ -23,6 +23,7 @@ Also see IANA assignments, https://www.iana.org/protocols
# Internet Message Format
822 Yes Obs Standard for ARPA Internet Text Messages
1847 No - Security Multiparts for MIME: Multipart/Signed and Multipart/Encrypted
1864 - - The Content-MD5 Header Field
2045 Yes - Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies
2046 Yes - Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types
2047 Yes - MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text
@ -30,12 +31,15 @@ Also see IANA assignments, https://www.iana.org/protocols
2076 - - Common Internet Message Headers
2183 Yes - Communicating Presentation Information in Internet Messages: The Content-Disposition Header Field
2231 Yes - MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations
2557 - - MIME Encapsulation of Aggregate Documents, such as HTML (MHTML)
3282 - - Content Language Headers
3629 - - UTF-8, a transformation format of ISO 10646
3676 No - The Text/Plain Format and DelSp Parameters
4155 - - The application/mbox Media Type
5234 - - Augmented BNF for Syntax Specifications: ABNF
5322 Yes - Internet Message Format
5598 - - Internet Mail Architecture
5646 - - Tags for Identifying Languages
6854 - - Update to Internet Message Format to Allow Group Syntax in the "From:" and "Sender:" Header Fields
7405 - - Case-Sensitive String Support in ABNF
9078 - - Reaction: Indicating Summary Reaction to a Message