fix(imap): issue when pattern is empty

Problem appear with some FTS backend

Ref #2336
This commit is contained in:
Christophe Chauvet
2026-01-13 20:46:03 +01:00
parent 062d2ccb62
commit 9c6a3f3c96
+4 -1
View File
@@ -301,7 +301,10 @@ class IMAPconnector:
key = "SUBJECT"
else:
continue
criterions = or_criterion(criterions, f'({key} "{pattern}")')
if pattern:
criterions = or_criterion(criterions, f'({key} "{pattern}")')
else:
criterions = "ALL"
self.criterions = [bytearray(criterions, "utf8")]
def messages_count(self, **kwargs) -> int: