fix(filter): correct account-field evaluation and reject header conditions #223

Merged
KofTwentyTwo merged 1 commits from story/m4-filter-correctness into dev 2026-07-30 00:19:37 +00:00
1 Commits
Author SHA1 Message Date
James Maes f952c10838 fix(filter): correct account-field evaluation and reject header conditions
The account condition field lumped in with folder and compared against
email.folder_id, so WHERE account = '...' would false-positive on any
message sharing a folder with the target account. Split the arm so it
reads email.account_id instead.

header[...] conditions silently evaluated to false forever because Email
has no parsed-headers field to match against. Reject header conditions
at validation time with an honest FieldTypeMismatch instead of accepting
a rule that can never fire; the runtime fallback is now documented as an
unreachable defensive branch.

Refs #191
2026-07-29 19:17:03 -05:00