Email domain blacklist with wildcards (revisited)

I’ve tried it with the following blacklist domain:

\d+\d\d\d.\w+

which should match any domain which is made up of four or more numbers (and numbers only).

I checked the setting with Data Explorer and confirms that email_domains_blacklist is mailinator.com|cc|\d+\d\d\d.\w+, which is correct.

The code regexp = Regexp.new("@(.+\.)?(#{domains})", true) should now filter off emails coming from domains with long digits.

EDIT: Note: not sure what the second parameter true is doing in a call to Regexp.new(), which takes as a second parameter the matching options.

However, I just had three new SPAMmers came through:

ddef@445555.com
mnopp@89990001.com
gg5@996399.net

So obviously it is not working.

Trying the RegExp in a JavaScript console confirms that it works:

/@(.+\.)?(mailinator\.com|cc|\d+\d\d\d\.\w+)/.test("ddef@445555.com")
true

There, the domain blacklist is not working as it should.

4 лайка