[GH-ISSUE #239] Subject Search not accepting umlauts #159

Closed
opened 2026-03-15 12:54:44 +03:00 by kerem · 3 comments
Owner

Originally created by @Tarboy3000 on GitHub (Jan 24, 2024).
Original GitHub issue: https://github.com/axllent/mailpit/issues/239

Given an email with a subject like
A subject with umlauts: Ä Ö Ü
searching via the query
subject:"Ä"
does not return the correct emails

Non-prefixed search seems to work with umlauts (which is the workaround I'm using currently), so searching Ö returns emails as expected.

Originally created by @Tarboy3000 on GitHub (Jan 24, 2024). Original GitHub issue: https://github.com/axllent/mailpit/issues/239 Given an email with a subject like `A subject with umlauts: Ä Ö Ü` searching via the query `subject:"Ä"` does not return the correct emails Non-prefixed search seems to work with umlauts (which is the workaround I'm using currently), so searching `Ö` returns emails as expected.
kerem 2026-03-15 12:54:44 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@axllent commented on GitHub (Jan 24, 2024):

I can confirm the bug, thanks for reporting it.

<!-- gh-comment-id:1907427129 --> @axllent commented on GitHub (Jan 24, 2024): I can confirm the bug, thanks for reporting it.
Author
Owner

@axllent commented on GitHub (Jan 25, 2024):

It turns out this is a limitation of SQLite, and there is no ideal solution as the embedded SQLite Mailpit uses (to provide multi-platform support) does not include the ICU extension (I do not think it is possible).

SQLite only understands upper/lower case for ASCII characters by default. The LIKE operator is case sensitive by default for unicode characters that are beyond the ASCII range. For example, the expression 'a' LIKE 'A' is TRUE but 'æ' LIKE 'Æ' is FALSE.

General searches are not affected as the search index Mailpit creates is lowercased by Mailpit before storing it in the database, and the search is (or rather was) lowercased before searching, however when searching by a specific field (eg subject:"Ä") a match would not be found unless the subject contained a lowercase "ä".

I have added a work-around which now assumes the searched unicode character matches the case of unicode character in the subject field. General searches (that don't specify a field) are not affected by this as everything is lowercased, however subject, to, from etc are stored in their original case in the database. This will be included in the next release.

<!-- gh-comment-id:1909539121 --> @axllent commented on GitHub (Jan 25, 2024): It turns out this is a [limitation of SQLite](https://www.sqlite.org/lang_expr.html#like), and there is no ideal solution as the embedded SQLite Mailpit uses (to provide multi-platform support) does not include the ICU extension (I do not think it is possible). > SQLite only understands upper/lower case for ASCII characters by default. The LIKE operator is case sensitive by default for unicode characters that are beyond the ASCII range. For example, the expression 'a' LIKE 'A' is TRUE but 'æ' LIKE 'Æ' is FALSE. General searches are not affected as the search index Mailpit creates is lowercased by Mailpit before storing it in the database, and the search is (or rather was) lowercased before searching, however when searching by a specific field (eg `subject:"Ä"`) a match would not be found unless the subject contained a lowercase "ä". I have added a work-around which now assumes the searched **unicode** character matches the case of unicode character in the subject field. General searches (that don't specify a field) are not affected by this as everything is lowercased, however subject, to, from etc are stored in their original case in the database. This will be included in the next release.
Author
Owner

@axllent commented on GitHub (Jan 27, 2024):

@Tarboy3000 This workaround has been included in v1.13.1. I'll mark this issue as resolved (as much as it can be for the reasons I mentioned before regarding unicode characters and SQLite), however if you experience any issues caused by this then please let me know. Thanks.

<!-- gh-comment-id:1913107275 --> @axllent commented on GitHub (Jan 27, 2024): @Tarboy3000 This workaround has been included in [v1.13.1](https://github.com/axllent/mailpit/releases/tag/v1.13.1). I'll mark this issue as resolved (as much as it can be for the reasons I mentioned before regarding unicode characters and SQLite), however if you experience any issues caused by this then please let me know. Thanks.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#159
No description provided.