|
|
|
@ -759,7 +759,7 @@ class User < Principal |
|
|
|
|
def self.mail_regexp(mail) |
|
|
|
|
separators = Regexp.escape(Setting.mail_suffix_separators) |
|
|
|
|
recipient, domain = mail.split('@').map { |part| Regexp.escape(part) } |
|
|
|
|
skip_suffix_check = Setting.mail_suffix_separators.empty? || recipient.match?(/.+[#{separators}].+/) |
|
|
|
|
skip_suffix_check = recipient.nil? || Setting.mail_suffix_separators.empty? || recipient.match?(/.+[#{separators}].+/) |
|
|
|
|
regexp = "#{recipient}([#{separators}][^@]+)*@#{domain}" |
|
|
|
|
|
|
|
|
|
[skip_suffix_check, regexp] |
|
|
|
|