Skip to content

fix: Various fixes for the search#394

Merged
marien-probesys merged 3 commits into2.4from
fix/search
Feb 13, 2026
Merged

fix: Various fixes for the search#394
marien-probesys merged 3 commits into2.4from
fix/search

Conversation

@marien-probesys
Copy link
Member

Related issue(s)

N/A

How to test manually

  1. Send an email to "user.domain.quota@blocnormal.fr" and another to "user@blocnormal.fr"
  2. Search for "@blocnormal.fr" and verify that all the emails are returned
  3. Search for "user@" and verify that the email to "user.domain.quota@blocnormal.fr" is not returned
  4. Send an email from "user@foo-bar.com" and an email with "foo" in the subject
  5. Search for "foo-bar.com" and check that only the email sent from "user@foo-bar.com" is returned
  6. Search for "foo" and verify that both emails are returned

Reviewer checklist

  • Code is manually tested
  • Interface works on both mobiles and big screens
  • Interface works on both Firefox and Chrome
  • Tests are up to date
  • Documentation is up to date
  • Pull request has been reviewed and approved

The individual terms of a search weren't correctly splitted. For
instance, the term "foo-bar" was sanitized as a single string "foo bar",
instead of being sanitized as two individual strings "foo" and "bar".

It means that when we added the mandatory sign (+), the MariaDB boolean
search string was returned as "+foo bar" instead of "+foo +bar".
MariDB indexes terms by removing the dots (.). It means that if we
searched for a term containing a dot (as an email address), the search
would return nothing.
Before, if an admin was looking for a recipient address, he must have to
search for the exact email (e.g. "charlie@example.com"). However, he
wasn't able to search for a part of the email (e.g. "example.com").

Now, we extract terms that contain a "@" and consider them as "potential
email". We then search for user emails with a "LIKE" request instead of
a "=". Thus, it allows to search "@example.com" for instance. The only
requirement is to contain a "@".
@marien-probesys marien-probesys changed the title Fix/search fix: Various fixes for the search Feb 12, 2026
@marien-probesys marien-probesys changed the base branch from main to 2.4 February 12, 2026 15:06
@marien-probesys marien-probesys merged commit 57bc0c7 into 2.4 Feb 13, 2026
3 checks passed
@marien-probesys marien-probesys deleted the fix/search branch February 13, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants