imapserver: implement the MULTISEARCH extension, with its ESEARCH command

This commit is contained in:
Mechiel Lukkien
2025-03-31 18:33:15 +02:00
parent 5dcf674761
commit 479bf29124
11 changed files with 969 additions and 188 deletions

View File

@ -965,6 +965,23 @@ func (sk searchKey) hasModseq() bool {
return false
}
// Whether we need message sequence numbers to evaluate. If not, we cannot optimize
// when only MAX is requested through a reverse query.
func (sk searchKey) needSeq() bool {
for _, k := range sk.searchKeys {
if k.needSeq() {
return true
}
}
if sk.searchKey != nil && sk.searchKey.needSeq() {
return true
}
if sk.searchKey2 != nil && sk.searchKey2.needSeq() {
return true
}
return sk.seqSet != nil && !sk.seqSet.searchResult
}
// ../rfc/9051:6489 ../rfc/3501:4692
func (p *parser) xdateDay() int {
d := p.xdigit()