14569 could you discuss (perhaps in a different discussion) what problems the Gmail alias create? What's the difference between a spammer using a regular Gmail address or one with an alias? It doesn't seem to me like this would cause any issue by itself. Do you mean they worked around an account ban with this trick? Unfortunately this will affect many email providers.
The best would be perhaps to check if there is any version of the email with or without alias already registered, and limit it to one. That way any user who wishes to use an alias for their main account can still do it, but will be prevented from creating additional accounts.
Some suggestions regarding the code: you could use the validator extender instead of a listener. The regex also seems overly complex. Because Flarum already checks for the validity of the email syntax, I think you could simply check for +
and .
before @
and have the same result.
I believe the dot alias in Gmail is not a common alias syntax among email hosting companies. I see your script handles it as well, which could be confusing for users. With this extension active it means I couldn't register with my address clark.winkelmann@gmail.com
, I would be forced to use the alternative syntax clarkwinkelmann@gmail.com
which I have never had to use on any website so far. The error message probably would be very confusing for anyone who has a dot in their email address and has no idea Gmail ignores it.