{{ message }}
Repository navigation
Conversation
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>
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds a
subject:filter to message search and%wildcard support forto:,from:andsubject:.%are still matched exactly, so existingto:/from:searches keep using equality.:likeoperator toMessageDB#hash_to_sql, quoted withescape_identifierper GHSA-x2hq-rfpg-3xr5, with specs (basic LIKE, quote escaping in the value, backtick injection in the key).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 thehash_to_sqlrefactor. 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 anybefore:/after:filters.Examples:
subject: "%invoice%"from: %@example.comto: rachel@example.com(exact, unchanged)