Email domain blacklist with wildcards


(Alex Harrington) #1

Hi

I’m trying to block email addresses from a particular domain - from which we seem to receive multiple spam user accounts per hour sigining up.

They come from .jil.kr where can be one of some 20 or so names I’ve seen so far.

I tried adding jil.kr but that doesn’t match, so then tried *.jil.kr instead but that gives an error in the log that the regex is invalid as there’s no subject for the * character, so I then tried (.*).jil.kr and that doesn’t match either - I think because the . character in the brackets is being escaped.

Is it possible to add an entry for *.jil.kr?


Email domain blacklist with wildcards (revisited)
(Jeff Atwood) #3

Yes, simply add jil.kr as I believe it enforces for all subdomains.


(Alex Harrington) #4

I did already try that, but I’ve put it back in and will see today if we get another signup from a subdomain of that.

Thanks

Alex


(Jeff Atwood) #5

Ok, let me know if it does not work. It should, if not we will make it work!


(Alex Harrington) #6

So with jil.kr in the email domain blacklist, we just had a signup from vil7421@stock.jil.kr so it doesn’t appear to work at present.

Also just now another from fdzr2860@bank.jil.kr

and another from prvhu5960@site.jil.kr

Sorry!


(Mittineague) #7

It must be considering everything after the @ to be the domain as opposed to "ends with"
Depending on how many variations are possible you’ll be playing whack-a-mole without some form of regex here.


#8

How about in addition to an exact match, if the end matches and the email address has a period immediately preceding the specified domain, that’s also a match.


(Jeff Atwood) #9

@techapj please make it so that this does a simple exact match, and then a ‘period ends with’ match on the string.

So if someone enters

jil.kr

in the email domain blacklist it will match all these:

foo.jil.kr
bar.jil.kr
jil.kr

but it should not match

mejil.kr


(Arpit Jalan) #10

Okay, made it so:

https://github.com/discourse/discourse/pull/3463


(Arpit Jalan) #11