cyrusimap / cyrus-imapd

Cyrus IMAP is an email, contacts and calendar server
http://cyrusimap.org
Other
517 stars 142 forks source link

JMAP: store uploaded blobs as application/octet-stream #4888

Closed rsto closed 3 weeks ago

rsto commented 1 month ago

JMAP blobs are untyped and storing the client-supplied media type may result in Cyrus message blobs having a wrong Content-Type header. This changes the JMAP blob upload handler to store blobs as application/octet-stream content, unless the uploaded blob is of type message/rfc822 and the blob passes our checks for valid messages of that type.

rsto commented 1 month ago

The problem here is that if a user uploads a JPEG to use as a contact avatar, we lose the type when creating the PHOTO property.

Right, that applies to the current non-standard JMAP Addressbook implementation. In JMAP, it would be up to the client to define the media type of the blob that they are embedding in the contact. Making this as Draft until that's resolved.

rsto commented 1 month ago

Turns out the current experimental API already provides the type property.