Email validation on registration is broken
user+example.com@example.org
is in every way a valid syntax for an email and it always was but hubzilla doesn't likes it.
Email address validation:
- Split local-part@host, with anchoring to the end of the string (as the local part can have an
@
). Like this:/^(?<user>.*)@(?<host>[^@]+)$/
- Verify that
host
is a valid hostname. Good enough method used in musl: Check if it's alphanumeric,.
,-
or higher than\u0080
(so outside of 8-bit codepoints so probably unicode) - Maybe verify you can actually use the local part (ie. unicode is invalid if you can't use SMTPUTF8). But otherwise don't the actual validation of it is delegated to the foreign host and the rules cannot be verified with a simple regex
Edited by Haelwenn Monnier