diff --git a/mail-worker/src/email/email.js b/mail-worker/src/email/email.js index 5abdb77..38f3374 100644 --- a/mail-worker/src/email/email.js +++ b/mail-worker/src/email/email.js @@ -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 } } diff --git a/mail-worker/src/entity/setting.js b/mail-worker/src/entity/setting.js index 4ff0eae..31bdd38 100644 --- a/mail-worker/src/entity/setting.js +++ b/mail-worker/src/entity/setting.js @@ -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(), diff --git a/mail-worker/src/init/init.js b/mail-worker/src/init/init.js index 894dc53..4385763 100644 --- a/mail-worker/src/init/init.js +++ b/mail-worker/src/init/init.js @@ -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();