Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Emails are not canonicalised on /_matrix/client/*/pushers/set #11458

@sandhose

Description

@sandhose

Description

Emails sent to /pushers/set are not canonicalised, while they probably should.

Steps to reproduce

  • choose an email with an uppercase letter in it, e.g. FooBar@example.com
  • set that email to a user via the admin API. The email will end up normalized in the DB
  • try to set an email pusher with the same email. It should work but doesn't and returns with an Email not found error

Version information

  • Homeserver: other
  • Version: 1.47.0
  • Install method: Docker/Kubernetes
  • Platform: N/A

Here, the pushkey should definitely be canonicalised for emails:

if kind == "email":
email_owner = await self.store.get_user_id_by_threepid("email", pushkey)
if email_owner != user_id:
raise SynapseError(400, "Email not found", Codes.THREEPID_NOT_FOUND)

using canonicalise_email:

def canonicalise_email(address: str) -> str:
"""'Canonicalise' email address
Case folding of local part of email address and lowercase domain part
See MSC2265, https://github.com/matrix-org/matrix-doc/pull/2265

Metadata

Metadata

Assignees

Labels

S-MinorBlocks non-critical functionality, workarounds exist.T-DefectBugs, crashes, hangs, security vulnerabilities, or other reported issues.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions