rnwood / smtp4dev

smtp4dev - the fake smtp email server for development and testing
BSD 3-Clause "New" or "Revised" License
3.07k stars 344 forks source link

Move search to server side #1375

Closed rnwood closed 6 months ago

rnwood commented 6 months ago

and deal with the consequences - notifications need to be retrieved separately.

rnwood commented 6 months ago

One of the current side effects is that (since SQLite doesn't support it with defaults) the case insensitivity will only apply to characters in the ASCII range. Whereas when it was client side, this took advantage of the browser's ability to apply the current locale.

I'd like to resolve this before merging if possible. Since it will affect many smtp4dev international users.

smchristensen commented 6 months ago

That's the direction I was going while looking at this. Since the search is server side and the base query returns the entire message, you could use something like the Boyer-Moore search algorithm to search on the data field of the message. This could effectively search the body of the message as well, right? If I'm wrong feel free to chastise. :)

rnwood commented 6 months ago

That's the direction I was going while looking at this. Since the search is server side and the base query returns the entire message, you could use something like the Boyer-Moore search algorithm to search on the data field of the message. This could effectively search the body of the message as well, right? If I'm wrong feel free to chastise. :)

No chastising needed! I would definitely love to add search that is searching the message content as well as the subject/to/from that it's currently doing. I'm going to log this as a separate feature though so I can get this bug fix out.

For now I've merged the server side search that is equivalent to the current client side search but without the paging drawback.

smchristensen commented 6 months ago

Thank you for this!