🐛 Bug Report: e-mail address should be case-insensitive #49

Closed
opened 2025-10-07 23:50:58 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @peterforeman on GitHub.

Reproduction steps

A user tried to login with e-mail, but did not get an e-mail with login token. After troubleshooting we discovered the e-mail was entered all lower case in pocket-id backend, but the user tried to login with some capitals (john.doe@example.com / John.Doe@example.com). This does not match since the SQL query does an exact match:

err := s.db.Model(&model.User{}).Select("id").Where("email = ?", userID).First(&userId).Error

Expected behavior

Make e-mail matching case insensitive.

Actual Behavior

The user did not get any mail.

Pocket ID Version

1.10.0

Database

SQLite (default install)

OS and Environment

Kubernetes cluster

Log Output

No response

Originally created by @peterforeman on GitHub. ### Reproduction steps A user tried to login with e-mail, but did not get an e-mail with login token. After troubleshooting we discovered the e-mail was entered all lower case in pocket-id backend, but the user tried to login with some capitals (john.doe@example.com / John.Doe@example.com). This does not match since the SQL query does an exact match: ``` err := s.db.Model(&model.User{}).Select("id").Where("email = ?", userID).First(&userId).Error``` ### Expected behavior Make e-mail matching case insensitive. ### Actual Behavior The user did not get any mail. ### Pocket ID Version 1.10.0 ### Database SQLite (default install) ### OS and Environment Kubernetes cluster ### Log Output _No response_
Author
Owner

@peterforeman commented on GitHub:

Ah great! I could not find it as duplicate. Indeed duplicate of #770, but making it case insensitive makes it far more user friendly because that is what most (if not all) users would expect.

@peterforeman commented on GitHub: Ah great! I could not find it as duplicate. Indeed duplicate of #770, but making it case insensitive makes it far more user friendly because that is what most (if not all) users would expect.
Author
Owner

@ItalyPaleAle commented on GitHub:

This was previously discussed here: https://github.com/pocket-id/pocket-id/issues/770

We changed Pocket ID to make the input field of type email so autocorrect wouldn't try to add capitalization.

Note that per RFC 2821:

The local-part of a mailbox MUST BE treated as case sensitive.

(Local-part is what's before @)

While most providers do treat emails in a case-insensitive way, it's allowed for a provider to treat John.Doe@example.com and john.doe@example.com as different emails. It's uncommon, but I have seen it myself at least once.

@ItalyPaleAle commented on GitHub: This was previously discussed here: https://github.com/pocket-id/pocket-id/issues/770 We changed Pocket ID to make the input field of type `email` so autocorrect wouldn't try to add capitalization. Note that per RFC 2821: > The local-part of a mailbox MUST BE treated as case sensitive. (Local-part is what's before `@`) While most providers do treat emails in a case-insensitive way, it's allowed for a provider to treat `John.Doe@example.com` and `john.doe@example.com` as different emails. It's uncommon, but I have seen it myself at least once.
Author
Owner

@kmendell commented on GitHub:

Closing this as as @ItalyPaleAle said the RFC states they should be marked as case sensitive.

@kmendell commented on GitHub: Closing this as as @ItalyPaleAle said the RFC states they should be marked as case sensitive.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-1#49