Anthony cab8e0be0c Surface mail attachments over IMAP as multipart/mixed parts
When the prefetch loop loads a mail's body, also load every entity in
`mail.attachments`, decrypt the blob data with the new SDK helper and
embed each attachment as a base64 part of a `multipart/mixed` RFC 2822
message. Thunderbird now renders PDFs / images / etc. inline rather
than showing a body-only mail with no hint anything was attached.

* `mail_to_rfc2822` now takes a slice of (TutanotaFile, &[u8]) and emits
  a multi-part envelope when it's non-empty; the simple text/html case
  is unchanged. The boundary is derived from the mail's IdTuple so the
  cached .eml.enc bytes stay stable across rewrites.
* `MailBackend::load_attachments` is the new trait method; the
  TutaSession implementation loads each File via `crypto_client.load`
  (auto-decrypted via the file's own `_ownerEncSessionKey`) then asks
  the new `MailFacade::load_file_attachment_data` for the concatenated
  decrypted bytes.
* `prefetch_details` does a best-effort fetch — partial failure logs a
  warning and ships the body alone, on the assumption the user can
  re-open later and the next sweep will retry.

A new unit test asserts the multipart structure (boundary, body part,
attachment part with name/MIME/filename, closing boundary).
2026-05-28 16:52:27 +02:00
Languages
Rust 89.5%
TypeScript 5.9%
CSS 2.5%
Python 1.2%
Shell 0.7%
Other 0.1%