Skip to content

Commit a055320

Browse files
committed
修复邮件接收异常
1 parent a860fd7 commit a055320

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

mail-worker/src/email/email.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,13 @@ export async function email(message, env, ctx) {
152152
attachment.accountId = emailRow.accountId;
153153
});
154154

155-
await attService.addAtt({ env }, attachments);
155+
try {
156+
if (attachments.length > 0) {
157+
await attService.addAtt({ env }, attachments);
158+
}
159+
} catch (e) {
160+
console.error(e);
161+
}
156162

157163
emailRow = await emailService.completeReceive({ env }, account ? emailConst.status.RECEIVE : emailConst.status.NOONE, emailRow.emailId);
158164

@@ -190,8 +196,8 @@ export async function email(message, env, ctx) {
190196
}
191197

192198
} catch (e) {
193-
194199
console.error('邮件接收异常: ', e);
200+
throw e
195201
}
196202
}
197203

mail-worker/src/entity/setting.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ export const setting = sqliteTable('setting', {
4040
endpoint: text('endpoint').default('').notNull(),
4141
s3AccessKey: text('s3_access_key').default('').notNull(),
4242
s3SecretKey: text('s3_secret_key').default('').notNull(),
43-
kvStorage: integer('kv_storage').default(1).notNull(),
4443
forcePathStyle: integer('force_path_style').default(1).notNull(),
4544
customDomain: text('custom_domain').default('').notNull(),
4645
tgMsgFrom: text('tg_msg_from').default('only-name').notNull(),

mail-worker/src/init/init.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ const init = {
3030
return c.text(t('initSuccess'));
3131
},
3232

33-
async v2_7DB(c) {
34-
try {
35-
await c.env.db.prepare(`ALTER TABLE account ADD COLUMN all_receive INTEGER NOT NULL DEFAULT 0;`).run();
36-
} catch (e) {
37-
console.error(e)
38-
}
39-
},
40-
4133
async v2_6DB(c) {
4234
try {
4335
await c.env.db.prepare(`ALTER TABLE account ADD COLUMN all_receive INTEGER NOT NULL DEFAULT 0;`).run();

0 commit comments

Comments
 (0)