Skip to content

mailcore: full-text search indexes HTML markup of HTML bodies #1905

Open

Description

@yeroo

Found while planning #1901 (mailcore: the engine can now fetch HTML bodies with
EngineOptions { body_format: BodyFormat::Html }).

The bodies_fts_ai / bodies_fts_au triggers (mailcore/src/store/schema.rs) copy
bodies.content verbatim into messages_fts.body. With an Html engine most stored bodies
are HTML, so Store::search matches tag names, attribute values, URLs and <style> CSS
(font, color, div, table hit almost every message). Local html drafts already have
this today; lookxy (Text) is unaffected.

Fix idea: index a text rendering of html bodies (htmlrender already turns HTML into text).
SQLite triggers cannot call Rust unless a function is registered on the connection, so either
register a body_text() SQL function used by the triggers, or maintain messages_fts from
put_body / put_fetched_body / the draft writers. The triggers are CREATE TRIGGER IF NOT EXISTS, so existing stores need a DROP/recreate migration plus a reindex of html bodies.

Source: #1901, PR #1904
Severity: minor; origin: plan v1

Activity

  1. added
    follow-upfiled automatically by an agworkbench loop
    priority:P2correctness defect that blocks nothing open
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    follow-upfiled automatically by an agworkbench looppriority:P2correctness defect that blocks nothing open

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions