-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Valid email addresses are rejected with The email address is invalid
, entirely preventing the use of gitea
#19852
Comments
This issue has been raised before, and closed as
https://davidcel.is/2012/09/06/stop-validating-email.html https://medium.com/hackernoon/the-100-correct-way-to-validate-email-addresses-7c4818f24643
If you are not going to send a validation email, then do not try to validate the email address; don't reject valid email addresses you haven't validated, because you cannot know they are invalid if you haven't tested their validity by verifying they are valid... |
Just bumping this to ensure it was seen; github (the platform itself) marked the issue as invalid, hid it, and locked my account for two weeks as a result |
This comment was marked as outdated.
This comment was marked as outdated.
I think yes, recent version has a more restricted limitation for email address than any RFC. For your example, both |
Plus since 2012 you can use international characters above U+007F, encoded as UTF-8. (just FYI, not sure whether Gitea should support it. there could be some comments or documents about supporting or not). |
I wold not allow all UTF-8 but more ASCI chars like _ |
Currently capital char is only allowed with |
If made a PR here : https://gitea.com/go-chi/binding/pulls/12 which uses the stdlib |
That function allow utf8 chars which was Gitea dropped. |
Ok, closed PR |
This was my worry when the email character restrictions were merged. There is really only one thing we should not be allowing outside of RFC5322:
but even that is really not our responsibility - it's only a problem with those running sendmail commands and the way they've configured the command. It should probably be an optional setting. I think that UTF-8 should be allowed - at least optionally - we're no longer in the 80s and whilst the majority of email addresses are still using only basic ASCII it's not really right to still be restricting in this matter. If there are issues with ambiguous characters (and there would be) we can fix the display of those (and in fact #19990 would provide the mechanism for doing this.) |
How about |
Many websites get this one wrong, because web developers are too lazy. |
This feels like something that is going to go round and round in circles. The restriction is in: gitea/models/user/email_address.go Lines 145 to 168 in 0e46499
If you want to change/relax this you will need to make a PR that changes the code here. You will also need to consider:
Code speaks louder than words. Make the PR. |
Hi, as a comparison. Gmail has a very restriction for email name(Only characters and digitals), and Github also doesn't allow unicode characters. And I also found another ref to support that https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email#basic_validation. |
I think we should be careful here to note that git will allow these extremely weird email addresses and Gitea will just use them. So by having this super-restrictive pattern we're not preventing weird and ambiguous email addresses from appearing in Gitea - just preventing the user from saying that one belongs to them. Further, the potential problem of email addresses being ambiguous/confusable with another user isn't particularly a much worse issue as the Gitea will not show the email address and will show the user that they map to instead. Thus unicode ambiguity of email addresses should only affect the user who the ambiguous email address belongs to. Next we should consider if there are potential sec issues by allowing arbitrary email addresses.
As far as I can see the only person affected by Gitea allowing users to register their own weird email address is the user itself. Thus apart from blocking the initial I might be missing something though - does anyone have any other ideas? |
The myth about the no leading Under both Linux and BSD, This should also be the case with all the other popular sendmail alternative MTAs like postfix and the rest. Sure, it's possible that some ancient version of a popular MTA didn't support |
That is exactly the problem: If we allow leading I don't even know why you would want an email address that starts with |
Non-argument. You can say that about any option & any command. If you don't know what you are doing, you can do everything the wrong way. Exhibit AIf you don't know, that this antiquated tool from pre-historic stone ages is using single dashes for long options, you are just as lost. Yet, this tool is (sadly) used all over the world & people deal with it.
Non-argument. Even more so, than the last one. Exhibit A"I don't even know why you would want a nickname like 'delvh', like why? Why not use your real name or a normal English word?" - someone could ask. If something is not forbidden, why make it "undesired" by convention? Such actions are usually much more confusing than an unusual case within the frame of what is allowed, because then you have millions of conventions, which are basically unwritten "rules" one "must" (not really) follow. Therefore, if it is allowed & according to the spec, it should work. Simple as that. If someone does not use a double dash or quotes or whatever options there are & then blaming the software design for it, is pretty much like saying "well, someone could type |
Just a reminder that this email filter doesn't really have anything to do with weird emails making their way into the database. Email addresses still get pulled in from git commits and stored in the db as-is, without going through this filter. Regardless, "someone might not know how to handle this" isn't really Gitea's problem. |
@lunny @Zettat123 |
The email you mentioned is considered as valid at least on main branch. What's the error when you edit it? |
@lunny @Zettat123 I blurred the username field for user protection and put another e-mail. I've tested several e-mail id but with the same domain and got the error message. |
OK. I think I just tested plain user but not SMTP user. I will test your use case. |
Description
Valid email addresses are rejected, preventing admin user, or any other user, creation; additionally, these same valid email addresses are rejected if a temporary one is added and attempted to fix with the valid one after the fact.
Example address that is not accepted, despite being perfectly valid under (among other standards):
Example:
Gitea Version
v1.16.8
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
not relevant
Database
MySQL
The text was updated successfully, but these errors were encountered: