mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-10-26 22:16:26 +08:00
allow to search messages from Junk/Trash
This commit is contained in:
parent
d5fdb3f4e2
commit
96fa19068a
4 changed files with 5 additions and 13 deletions
|
|
@ -1026,7 +1026,7 @@ module.exports = (db, server, messageHandler, userHandler, storageHandler) => {
|
|||
try {
|
||||
mailboxes = await db.database
|
||||
.collection('mailboxes')
|
||||
.find({ user })
|
||||
.find({ user, specialUse: { $nin: ['\\Junk', '\\Trash'] } })
|
||||
.project({
|
||||
_id: true
|
||||
})
|
||||
|
|
|
|||
|
|
@ -175,11 +175,7 @@ module.exports = (server, messageHandler) => (mailbox, update, session, callback
|
|||
messageData.rdate = Date.now() + (targetData.retention || 0);
|
||||
messageData.modseq = modifyIndex; // reset message modseq to whatever it is for the mailbox right now
|
||||
|
||||
if (['\\Junk', '\\Trash'].includes(targetData.specialUse)) {
|
||||
delete messageData.searchable;
|
||||
} else {
|
||||
messageData.searchable = true;
|
||||
}
|
||||
messageData.searchable = true;
|
||||
|
||||
let junk = false;
|
||||
if (targetData.specialUse === '\\Junk' && !messageData.junk) {
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ module.exports = server => (mailbox, update, session, callback) => {
|
|||
shouldExpunge = true;
|
||||
}
|
||||
|
||||
if (!['\\Junk', '\\Trash'].includes(mailboxData.specialUse) && !message.flags.includes('\\Deleted')) {
|
||||
if (!message.flags.includes('\\Deleted')) {
|
||||
flagsupdate.$set.searchable = true;
|
||||
} else {
|
||||
flagsupdate.$unset = {
|
||||
|
|
|
|||
|
|
@ -859,11 +859,7 @@ class MessageHandler {
|
|||
|
||||
let unseen = message.unseen;
|
||||
|
||||
if (['\\Junk', '\\Trash'].includes(targetData.specialUse) || !message.undeleted) {
|
||||
delete message.searchable;
|
||||
} else {
|
||||
message.searchable = true;
|
||||
}
|
||||
message.searchable = true;
|
||||
|
||||
let junk = false;
|
||||
if (targetData.specialUse === '\\Junk' && !message.junk) {
|
||||
|
|
@ -1082,7 +1078,7 @@ class MessageHandler {
|
|||
messageData.exp = !!mailboxData.retention;
|
||||
messageData.rdate = Date.now() + (mailboxData.retention || 0);
|
||||
|
||||
if (['\\Junk', '\\Trash'].includes(mailboxData.specialUse) || !mailboxData.undeleted) {
|
||||
if (!mailboxData.undeleted) {
|
||||
delete messageData.searchable;
|
||||
} else {
|
||||
messageData.searchable = true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue