-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Prevent users from reusing a banned email after account is purged #19413
base: dev
Are you sure you want to change the base?
Conversation
Test failures unrelated. |
Would it make sense to consolidate this with the email-domain-blocklist? |
I don't think so. The application of the domain blocklist rule is contingent on the existence of the allowlist - i.e., by specifying an allowlist we block everything else, which makes the blocklist useless, which is why it is ignored in such cases. Thus, if we had "foo.com" in the allowlist, we couldn't block Could we change this logic and process the blocklist regardless to weed out exceptions? Sure. But, I think, that would lead to a more complex implementation: we'd have to combine the allowlist/blocklist logic with the banned emails logic - the ordering, as well as processing the domain part and the local-part of each entry. Whereas keeping them separate, I think, keeps the logic simple: first check if the actual email is banned, then process allow/block domain lists. For the admin, I think having 2 lists, one of blocked domains and one of blocked addresses, should be easier to manage than a combined list of domains and addresses, even though it's two files instead of one. Duplication of domains across lists is not an issue. To me, the following looks more difficult to manage than two separate lists (see how domains and emails are interspersed after a sort):
|
localpart, domain = email.split("@") | ||
if domain == "gmail.com": | ||
localpart = localpart.replace(".", "") | ||
if localpart.find("+") > -1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
plus addressing / sub addressing is not a gmail exclusive feature. This works on many mail servers
""" | ||
email = email.lower() | ||
localpart, domain = email.split("@") | ||
if domain == "gmail.com": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also "googlemail.com"
There are many ways to alias a mail. I suggest we catch some common ones we can find with a configuration file which admins can extend, should the need arise: all:
plus_addressing: true
gmail:
aliases:
- gmail.com
- googlemail.com
ignore_dots: true
proton:
aliases:
- proton.me
- pm.me
- protonmail.com
[...] |
if you mean email_domain_blocklist_file I do not think that would bring us benefits. They serve different purposes and I doubt there is that big of an overlap within domains even. +1 to @ElectronicBlueberry comments above |
Implements #19095
How to test the changes?
(Select all options that apply)
License