修复使用S3有时无法接收邮件

This commit is contained in:
eoao
2025-09-05 16:23:46 +08:00
parent e8eaa7d45b
commit 19846f3084
4 changed files with 446 additions and 180 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
"wrangler": "^4.7.0"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.879.0",
"@aws-sdk/client-s3": "^3.882.0",
"@cloudflare/vite-plugin": "1.6.0",
"dayjs": "^1.11.13",
"drizzle-orm": "^0.42.0",
+439 -178
View File
File diff suppressed because it is too large Load Diff
+5 -1
View File
@@ -147,7 +147,11 @@ export async function email(message, env, ctx) {
});
if (attachments.length > 0 && await r2Service.hasOSS({env})) {
await attService.addAtt({ env }, attachments);
try {
await attService.addAtt({ env }, attachments);
} catch (e) {
console.error(e)
}
}
emailRow = await emailService.completeReceive({ env }, account ? emailConst.status.RECEIVE : emailConst.status.NOONE, emailRow.emailId);
+1
View File
@@ -61,6 +61,7 @@ const s3Service = {
accessKeyId: s3AccessKey,
secretAccessKey: s3SecretKey,
},
forcePathStyle: true
});
}
}