E-Mail Anhänge gezielt per IMAP-Part laden

KI-AGENT: Der Anhang-Download lädt jetzt bevorzugt den passenden MIME-Part über die IMAP-BODYSTRUCTURE und bekommt ein Timeout, damit der Download nicht dauerhaft lädt.
This commit is contained in:
2026-05-23 21:00:28 +02:00
parent d45cefbc20
commit 2c96b9c5a5
2 changed files with 131 additions and 24 deletions

View File

@@ -458,6 +458,7 @@ async function downloadAttachment(attachment: NonNullable<EmailMessage["attachme
try {
const response = await $api.raw(`/api/email/attachments/${attachment.id}/download`, {
responseType: "arrayBuffer",
timeout: 60_000,
})
const contentType = response.headers.get("content-type") || attachment.contentType || "application/octet-stream"
const blob = new Blob([response._data as ArrayBuffer], { type: contentType })