From c2715d78d3df1acbb1aab03dc645e0038380534a Mon Sep 17 00:00:00 2001 From: gitadmin Date: Fri, 10 Jul 2026 13:52:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BD=BF=E7=94=A8=20body:=20''=20?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=82=AE=E4=BB=B6=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 使用 body: '' 替代 rfc822: true,尝试获取完整邮件内容 - 添加多种获取方式的回退逻辑 --- src/app/api/monitor/scan-emails/route.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/api/monitor/scan-emails/route.ts b/src/app/api/monitor/scan-emails/route.ts index e47fb6d..5081727 100644 --- a/src/app/api/monitor/scan-emails/route.ts +++ b/src/app/api/monitor/scan-emails/route.ts @@ -208,15 +208,15 @@ async function scanEmails( } try { - // 使用 rfc822 获取完整邮件内容(兼容性最好) - const msg = await client.fetchOne(uid, { uid: true, rfc822: true }, { uid: true }) + // 使用 body: '' 获取完整邮件内容 + const msg = await client.fetchOne(uid, { uid: true, body: '' }, { uid: true }) if (!msg) { console.log(`[Scan] 邮件 ${uid} 获取失败,跳过`) continue } - // 优先使用 source,其次使用 rfc822 - const rawSource = (msg as any).source || (msg as any).rfc822 + // 尝试多种方式获取邮件内容 + const rawSource = (msg as any).source || (msg as any).body || (msg as any).rfc822 if (!rawSource) { console.log(`[Scan] 邮件 ${uid} 无内容,跳过 (keys: ${Object.keys(msg).join(',')})`) continue