Repository navigation
Email addresses #6100
Replies: 23 comments
|
Here are the tests for valid and invalid email addresses, used by the GOV.UK Notify team: https://github.com/alphagov/notifications-utils/blob/e428bdd0ca82f7b97833e707eea95dae849713fb/tests/test_recipient_validation.py#L103-L149 |
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
This comment has been hidden.
|
@timpaul we're using gov.uk Notify over at the ONS and we've been looking into the valid/invalid emails. According to Wikipedia, the local part of the email supports a lot more weird and wonderful characters and things than Notify does: https://en.wikipedia.org/wiki/Email_address#Local-part Specifically, the special characters Also, the example with the 2 consecutive dots which is "technically valid" according to the source link you pasted is actually invalid according to the Wiki article. Confused about what we should implement in our UI. Any pointers gratefully received. Cheers! |
This comment has been hidden.
This comment has been hidden.
|
Hi @NickGrantONS, I'm a developer over on Gov.uk Notify. While being careful not to derail this conversation too much, a couple of points about the validation. We've tweaked our validation quite a bit since Tim commented with that link - check out the current version at https://github.com/alphagov/notifications-utils/blob/master/tests/test_recipient_validation.py#L104-L151 (the regexes used can be found at Those special characters you listed are now valid, and the consecutive dots example is now correctly invalid. That said, we still don't allow some very unusual email addresses that are technically valid - notably emails with the local part wrapped in double quotes. We've never seen any of these emails in the wild, and it would greatly increase the complexity of our validation logic. Our goal is simply "Have notify's validation match our own email provider's validation" (we currently use Amazon SES) - so that we can reject any invalid email addresses as soon as we receive them. If you want to be sure we'll accept the email address, you could send a message to the supplied email address via notify using a |
This comment has been hidden.
This comment has been hidden.
|
Here are 2 things that the GOV.UK Pay team have done to help users enter correct emails:
Doing this has reduced instances of users entering invalid emails by 33% |
|
The guidance suggests:
Should that say set |
|
I think the MDN docs are clearer here. The
Whereas, if it's set to |
|
@peteryates Fair one, I hadn't seen the list of permissible values, I thought it was simply |
|
Hi, I have a question regarding the recommended use of the “The autocomplete feature was enabled within the application that stored sensitive user data. The autocomplete attribute, implemented by many popular browsers, allows a user the option of storing form field values so that the browser can automatically populate the same fields of a form later. Although this feature can be a convenience for users of the application, it creates a security risk, as sensitive user data such as authentication credentials is stored locally and may be recovered if an attacker is able to gain access to the workstation, or through exploitation of a cross-site scripting vulnerability. RECOMMENDATION So, do people think it is a security issue and therefore we should not be using it? |
|
I'm jumping in here with no background of other tickets, so apologies if you're raising this in another ticket. The reasoning to use the autocomplete attribute should also touch on how useful it is for people with a variety of impairments, as part of WCAG 1.3.5 (AA) Identify Input Purpose. I couldn't phrase this better so I'm taking it from the 'understanding' document of 1.3.5:
|
|
@mcheung-nhs its a risk that would need to be either accepted or fixed depending on the situation. If it’s related to login forms NCSC has guidance that’s says you should allow users to paste/use password managers. If it’s search field, then if there is a chance the computer could be shared then there is a data leak risk. |
|
We implemented a version of #6029 (comment) in a recent service - after engaging with the gov.uk pay team ... as soon as our research / analysis of the difference it made is finalised will post it |
|
Is there any updates/insights with regards this pattern? @sdh100shaun You said you were implementing this, how did it go? |
|
@a184studio we are still doing overall analysis I will see with our performance analyst where it has got to |
Hi Tim Paul, I was looking for some examples of email validation and I came across your screenshots. I've seen the post is from 2018, so not sure if you are still involved or have access to the documentation :( Would you, or anybody else in the chat, have examples of re-playing the email address backed up with UR please? Thank you!! |
|
@cristina-agramunt I can help with this one. We didn't do the predictive element, just the "you need to do this again field" |
Hi Mark, Thank you so much for your quick reply! That's exactly what I was looking for!! Thank you again for your help!! Cristina |
|
How is everyone translating this error message into Welsh? Our translators have given us this, but I'm unsure about the email address: While it's true that example.com may not mean anything to a Welsh speaker, it is based on RFC2606 and there is explanatory text at http://example.com if someone looks it up. Whereas "enghraifft.com" is non-standard and (at the time of writing) unregistered. |
|
@RichardBradley I agree with your reckon here. example.com is a reserved domain specifically for uses like this one, and as there is no non-English equivalent, it should probably be used regardless of the surrounding language. |
|
Hi @timpaul @cristina-agramunt @a184studio and others: We would like to add the "common misspellings of popular email providers" check to our service. Is there open code for your version of this or a reference version of this that we can re-use, please? In particular, where can we get a list of "popular email providers" and code for what counts as a "misspelling"? Is the code for the "Apply for a National Insurance number" service open anywhere? I found a few things that looked similar on GitHub but I don't think I've found it yet. Thanks! EDIT: so far gov slack has turned up this from petition.parliament.uk: https://github.com/alphagov/e-petitions/blob/master/lib/domain_autocorrect.rb |







Uh oh!
There was an error while loading. Please reload this page.
Use this issue to discuss this pattern in the GOV.UK Design System.
All reactions