feat: add subject search and % wildcards for to/from/subject filters by flightnut · Pull Request #3646 · postalserver/postal · GitHub
Skip to content

feat: add subject search and % wildcards for to/from/subject filters - #3646

Open
flightnut wants to merge 1 commit into
postalserver:mainfrom
flightnut:feat/subject-search
Open

flightnut wants to merge 1 commit into
postalserver:mainfrom
flightnut:feat/subject-search

Conversation

@flightnut

@flightnut flightnut commented Oct 1, 2026 •

Copy link
Copy Markdown

Adds a subject: filter to message search and % wildcard support for to:, from: and subject:.

  • Values without % are still matched exactly, so existing to:/from: searches keep using equality.
  • Adds a :like operator to MessageDB#hash_to_sql, quoted with escape_identifier per GHSA-x2hq-rfpg-3xr5, with specs (basic LIKE, quote escaping in the value, backtick injection in the key).
  • Search help text documents subject: and the wildcards (and fixes the "sent from to" typo).

This is a clean feature branch per the feedback on #1594, and follows the "only use LIKE when the value contains %" feedback on #3399, which no longer merges cleanly against main after the hash_to_sql refactor. Credit to @slobodangacesa for the original approach (co-author on the commit).

Note: a leading-% pattern can't use an index; queries are still bounded by scope/spam and any before:/after: filters.

Examples:

  • subject: "%invoice%"
  • from: %@example.com
  • to: rachel@example.com (exact, unchanged)

Adds a subject: filter to the message search and lets to:, from: and
subject: take % wildcards. Values without % are still matched exactly,
so existing to:/from: searches keep using equality.

Adds a :like operator to MessageDB hash_to_sql, built on the
escape_identifier quoting from the GHSA-x2hq-rfpg-3xr5 fix, with specs.

Based on the approach in postalserver#3399 and the earlier postalserver#1594.

Co-authored-by: slobodangacesa <12434746+slobodangacesa@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 1, 2026 17:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@flightnut
flightnut requested a balanced review from Copilot October 2, 2026 12:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@willpower232

Copy link
Copy Markdown
Collaborator

@flightnut

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants