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

This commit is contained in:
eoao
2025-09-05 16:23:46 +08:00
parent 2fd34b407e
commit b046f49ea2
4 changed files with 446 additions and 180 deletions

View File

@@ -14,7 +14,7 @@
"wrangler": "^4.7.0" "wrangler": "^4.7.0"
}, },
"dependencies": { "dependencies": {
"@aws-sdk/client-s3": "^3.879.0", "@aws-sdk/client-s3": "^3.882.0",
"@cloudflare/vite-plugin": "1.6.0", "@cloudflare/vite-plugin": "1.6.0",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"drizzle-orm": "^0.42.0", "drizzle-orm": "^0.42.0",

File diff suppressed because it is too large Load Diff

View File

@@ -147,7 +147,11 @@ export async function email(message, env, ctx) {
}); });
if (attachments.length > 0 && await r2Service.hasOSS({env})) { 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); emailRow = await emailService.completeReceive({ env }, account ? emailConst.status.RECEIVE : emailConst.status.NOONE, emailRow.emailId);

View File

@@ -61,6 +61,7 @@ const s3Service = {
accessKeyId: s3AccessKey, accessKeyId: s3AccessKey,
secretAccessKey: s3SecretKey, secretAccessKey: s3SecretKey,
}, },
forcePathStyle: true
}); });
} }
} }