修复邮件接收异常

This commit is contained in:
eoao
2026-01-01 18:45:15 +08:00
parent a860fd7116
commit a0553203ce
3 changed files with 8 additions and 11 deletions
+8 -2
View File
@@ -152,7 +152,13 @@ export async function email(message, env, ctx) {
attachment.accountId = emailRow.accountId;
});
await attService.addAtt({ env }, attachments);
try {
if (attachments.length > 0) {
await attService.addAtt({ env }, attachments);
}
} catch (e) {
console.error(e);
}
emailRow = await emailService.completeReceive({ env }, account ? emailConst.status.RECEIVE : emailConst.status.NOONE, emailRow.emailId);
@@ -190,8 +196,8 @@ export async function email(message, env, ctx) {
}
} catch (e) {
console.error('邮件接收异常: ', e);
throw e
}
}
-1
View File
@@ -40,7 +40,6 @@ export const setting = sqliteTable('setting', {
endpoint: text('endpoint').default('').notNull(),
s3AccessKey: text('s3_access_key').default('').notNull(),
s3SecretKey: text('s3_secret_key').default('').notNull(),
kvStorage: integer('kv_storage').default(1).notNull(),
forcePathStyle: integer('force_path_style').default(1).notNull(),
customDomain: text('custom_domain').default('').notNull(),
tgMsgFrom: text('tg_msg_from').default('only-name').notNull(),
-8
View File
@@ -30,14 +30,6 @@ const init = {
return c.text(t('initSuccess'));
},
async v2_7DB(c) {
try {
await c.env.db.prepare(`ALTER TABLE account ADD COLUMN all_receive INTEGER NOT NULL DEFAULT 0;`).run();
} catch (e) {
console.error(e)
}
},
async v2_6DB(c) {
try {
await c.env.db.prepare(`ALTER TABLE account ADD COLUMN all_receive INTEGER NOT NULL DEFAULT 0;`).run();