fix : test email : more detail
This commit is contained in:
@@ -255,7 +255,7 @@ export class EmailSpamService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for emails from this sender in various mailboxes
|
// Check for emails from this sender in various mailboxes
|
||||||
let emailsFromSender: any = {
|
const emailsFromSender: any = {
|
||||||
inbox: [],
|
inbox: [],
|
||||||
junk: [],
|
junk: [],
|
||||||
trash: [],
|
trash: [],
|
||||||
@@ -264,8 +264,6 @@ export class EmailSpamService {
|
|||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const mailboxIds = await this.mailboxResolverService.getUserMailboxIds(wildduckUserId);
|
|
||||||
|
|
||||||
// Search for messages from this sender domain
|
// Search for messages from this sender domain
|
||||||
const searchQuery = { from: `@${senderDomain}`, limit: 50 };
|
const searchQuery = { from: `@${senderDomain}`, limit: 50 };
|
||||||
const searchResults = await firstValueFrom(this.mailServerService.messages.searchMessages(wildduckUserId, searchQuery));
|
const searchResults = await firstValueFrom(this.mailServerService.messages.searchMessages(wildduckUserId, searchQuery));
|
||||||
@@ -276,11 +274,6 @@ export class EmailSpamService {
|
|||||||
// Check which mailbox each message is in
|
// Check which mailbox each message is in
|
||||||
for (const message of searchResults.results) {
|
for (const message of searchResults.results) {
|
||||||
try {
|
try {
|
||||||
// Get message details to find mailbox
|
|
||||||
const messageDetails = await firstValueFrom(
|
|
||||||
this.mailServerService.messages.getMessage(wildduckUserId, message.mailbox, message.id)
|
|
||||||
);
|
|
||||||
|
|
||||||
const mailboxName = await this.mailboxResolverService.getMailboxName(wildduckUserId, message.mailbox);
|
const mailboxName = await this.mailboxResolverService.getMailboxName(wildduckUserId, message.mailbox);
|
||||||
|
|
||||||
if (mailboxName === "INBOX") {
|
if (mailboxName === "INBOX") {
|
||||||
@@ -312,7 +305,7 @@ export class EmailSpamService {
|
|||||||
date: message.date,
|
date: message.date,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (_error) {
|
||||||
// Skip if we can't get message details
|
// Skip if we can't get message details
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user