-
-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Case for date
for term.key
missing in onSearch
function
#560
Comments
One thing we did to simplify things: case 'headerdate':
case 'internaldate':
case 'date': {
// .. logic (see below too)
}
...
// and then in the case statement just use the corresponding property to `term.key`:
// headerdate => hdate
// internaldate => idate
// date => date
let entryKey;
switch (term.key) {
case 'headerdate': {
entryKey = 'hdate';
break;
}
case 'internaldate': {
entryKey = 'idate';
break;
}
case 'date': {
entryKey = 'date';
break;
}
default: {
throw new TypeError(`${term.key} unsupported`);
}
} And then implement as: entry = {
+ [entryKey]: !ne
- idate: !ne
? entry
: {
$not: entry
}
}; |
date
for term.key
missing in onSearch
functiondate
for term.key
missing in onSearch
function (and also =
operator condition missing)
date
for term.key
missing in onSearch
function (and also =
operator condition missing)date
for term.key
missing in onSearch
function
Ignore previous comment regarding |
Actually, instead of #560 (comment) we would need to do an |
Our final (working) solution: // headerdate => hdate
// internaldate => idate
// date => $or
// <https://github.com/nodemailer/wildduck/issues/560>
switch (term.key) {
case 'headerdate': {
entry = {
hdate: ne
? {
$not: entry
}
: entry
};
break;
}
case 'internaldate': {
entry = {
idate: ne
? {
$not: entry
}
: entry
};
break;
}
case 'date': {
entry = {
$or: [
{
hdate: ne
? {
$not: entry
}
: entry
},
{
idate: ne
? {
$not: entry
}
: entry
}
]
};
break;
}
default: {
throw new TypeError(`${term.key} unsupported`);
}
}
parent.push(entry); |
Did you check your implementation against rfc3501#6.4.4? It is pretty specific on how to compare dates when searching. |
WildDuck is already parsing these and setting the key as ❯ rg "headerdate"
lib/handlers/on-search.js
247: case 'headerdate': You can see the mapping right now maps |
Oh, I see it now, instead of |
PR submitted at #561 |
Right now the only two keys related to date supported for search are
internaldate
andheaderdate
. If you are usingimap-flow
to search a mailbox, then the date key is not supported:Ref:
wildduck/lib/handlers/on-search.js
Lines 204 to 288 in ea24b93
The text was updated successfully, but these errors were encountered: