mirror of
https://github.com/spartanz51/tutabridge.git
synced 2026-06-24 10:54:32 +02:00
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).