Skip to content
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

FEATURE: Add email blocking using regex #14481

Closed
wants to merge 1 commit into from

Conversation

nbianca
Copy link
Member

@nbianca nbianca commented Sep 30, 2021

blocked_email_pattern site setting can block email matching a regular
expression.

blocked_email_pattern site setting can block email matching a regular
expression.
elsif (setting = SiteSetting.blocked_email_domains).present?
return !(email_in_restriction_setting?(setting, email) && !is_developer?(email))
elsif SiteSetting.blocked_email_domains.present? || SiteSetting.blocked_email_pattern.present?
return !(email_in_restriction_setting?(SiteSetting.blocked_email_domains, email) ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need these two methods? Or would just one be enough?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One accepts a regular expression and the other one accepts a list of domains and converts it to a regular expression. I'd say yes, because the alternative is to convert it to regular expression before calling the method.

@nbianca
Copy link
Member Author

nbianca commented Oct 26, 2021

There is another better implementation for the same problem #14593.

@nbianca nbianca closed this Oct 26, 2021
@nbianca nbianca deleted the feature_blocked_email_pattern branch February 13, 2023 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants