Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/imap-flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -1992,6 +1992,7 @@ class ImapFlow extends EventEmitter {
* @property {String} [keyword] Matches messages that have the custom flag set
* @property {String} [unKeyword] Matches messages that do not have the custom flag set
* @property {Object.<string, Boolean|String>} [header] Matches messages with header key set if value is `true` (**NB!** not supported by all servers) or messages where header partially matches a string value
* @property {SearchObject} [not] A {@link SearchObject} object. It must not match.
* @property {SearchObject[]} [or] An array of 2 or more {@link SearchObject} objects. At least on of these must match
*/

Expand Down
13 changes: 13 additions & 0 deletions lib/search-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,19 @@ module.exports.searchCompiler = (connection, query) => {
}
break;

case 'NOT':
{
if (!params[term]) {
break;
}

if (typeof params[term] === 'object') {
attributes.push({ type: 'ATOM', value: 'NOT' });
walk(params[term]);
}
}
break;

case 'OR':
{
if (!params[term] || !Array.isArray(params[term]) || !params[term].length) {
Expand Down