KamoCRM

Search that honours its query, and every mail action on the mailbox that is open

FixEmailService
Shipped
September 23, 2026 at 6:11 AM UTC
Author
Kamo
Commit
9809d4b

Two problems on /messages, fixed in the service. Search did not work. The index path threw a ClassCastException on every hit (Instant -> Timestamp, visible in the pod logs), so every search fell back to an IMAP search that threw the operators away and looked for the free text alone - or, with no free text, for the first operator's VALUE anywhere in the message. The index was also incomplete (275 of 398 rows in one inbox, no Sent bodies) and keyed by member, so it could never have answered for another mailbox; and the free text was interpolated into an ORDER BY. Search is now a parsed query (MailSearchParser: Gmail's language - phrases, -exclusion, OR, brackets, from/to/cc/bcc/subject/body, has:attachment, filename:, is:, in:, label:, before/after/on, older_than/newer_than, larger/smaller) answered by the mail server itself: IMAP SEARCH per folder, with labels and file names evaluated beside it and combined as bit sets, and KQL for Microsoft 365. It can look in the folder on screen or in every folder but Trash and Spam (scope=all), resolves in:sent to whatever the server calls that folder, pages newest first, and reports what it could not use as warnings instead of guessing. The dead index-search classes are removed. Mailbox switching failed. Deleting, moving, reporting spam, folder management, search and the bulk actions took no mailbox and acted on the member's own - at whichever message carried the same UID. Every one of them now resolves its target through MailboxTargetResolver (mailboxId or sharedMailboxId, access checked, 400/403 instead of a 500), and only the member's own mailbox touches the metadata index. Batch actions go through the provider rather than raw KamoMail credentials, which also gives Microsoft 365 and Google members a working bulk action. The send path is untouched.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing