修复邮件数量统计错误
This commit is contained in:
@@ -62,7 +62,7 @@ export async function email(message, env, ctx) {
|
||||
|
||||
let { banEmail, banEmailType, availDomain } = await roleService.selectByUserId({ env: env }, account.userId);
|
||||
|
||||
if(!roleService.hasAvailDomainPerm(availDomain, message.to)) {
|
||||
if (!roleService.hasAvailDomainPerm(availDomain, message.to)) {
|
||||
message.setReject('Mailbox disabled');
|
||||
return;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ export async function email(message, env, ctx) {
|
||||
|
||||
if (banEmail.includes('*')) {
|
||||
|
||||
if (!banEmailHandler(banEmailType,message,email)) return
|
||||
if (!banEmailHandler(banEmailType, message, email)) return;
|
||||
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ export async function email(message, env, ctx) {
|
||||
|
||||
if (banDomain === receiveDomain) {
|
||||
|
||||
if (!banEmailHandler(banEmailType,message,email)) return
|
||||
if (!banEmailHandler(banEmailType, message, email)) return;
|
||||
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ export async function email(message, env, ctx) {
|
||||
|
||||
if (item.toLowerCase() === email.from.address.toLowerCase()) {
|
||||
|
||||
if (!banEmailHandler(banEmailType,message,email)) return
|
||||
if (!banEmailHandler(banEmailType, message, email)) return;
|
||||
|
||||
}
|
||||
|
||||
@@ -146,12 +146,12 @@ export async function email(message, env, ctx) {
|
||||
attachment.accountId = emailRow.accountId;
|
||||
});
|
||||
|
||||
if (attachments.length > 0 && await r2Service.hasOSS({env})) {
|
||||
try {
|
||||
try {
|
||||
if (attachments.length > 0 && await r2Service.hasOSS({ env })) {
|
||||
await attService.addAtt({ env }, attachments);
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
emailRow = await emailService.completeReceive({ env }, account ? emailConst.status.RECEIVE : emailConst.status.NOONE, emailRow.emailId);
|
||||
@@ -225,11 +225,11 @@ ${params.text || emailUtils.htmlToText(params.content) || ''}
|
||||
}
|
||||
}
|
||||
|
||||
function banEmailHandler(banEmailType,message,email) {
|
||||
function banEmailHandler(banEmailType, message, email) {
|
||||
|
||||
if (banEmailType === roleConst.banEmailType.ALL) {
|
||||
message.setReject('Mailbox disabled');
|
||||
return false
|
||||
return false;
|
||||
}
|
||||
|
||||
if (banEmailType === roleConst.banEmailType.CONTENT) {
|
||||
@@ -238,6 +238,6 @@ function banEmailHandler(banEmailType,message,email) {
|
||||
email.attachments = [];
|
||||
}
|
||||
|
||||
return true
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user