Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

email: validate addresses following the HTML specs #978

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

nicolas-guichard
Copy link
Contributor

If we validate email addresses, at least do it by following some existing specification and document it.

It remains on app developers to:

  • make sure addresses are ASCII-only, by converting international labels to Punycode
  • remove anything but the addresses, Some Name <[email protected]> is not accepted

Fixes #944 (closed in a hurry by @matthiasclasen but @smcv agreed there was a bug to solve)

@smcv
Copy link
Collaborator

smcv commented Mar 2, 2023

The regular expression is terrifying and I haven't reviewed it in detail, but I think this is a good approach.

Copy link
Collaborator

@ebassi ebassi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, too.

If we are going to try and validate email addresses, at least do it by
following some existing specification and document it.

It remains on app developpers to:
 * make sure their addresses are ASCII-only, by converting international
   labels to Punycode
 * remove anything but the addresses, `Some Name <[email protected]>` is
   not accepted

[smcv: Fix merge conflicts in tests/test_email.py]
Co-authored-by: Simon McVittie <[email protected]>
@smcv
Copy link
Collaborator

smcv commented Sep 14, 2023

Rebased to fix conflicts with current git main.

@smcv smcv added this pull request to the merge queue Sep 14, 2023
Merged via the queue into flatpak:main with commit a2ccb56 Sep 14, 2023
3 checks passed
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.

email portal: email address validation is too strict
3 participants