YAFLogo

tecman
  • tecman
  • 100% (Exalted)
  • YAF All-the-Time Topic Starter
10 years ago
I need to ban all new users of my forum with emails that end with @163.com (they always post spam).

To do that, I open the Forum settings, then Spam protection, Banned Emails and add a new mask. The description under the mask field tells me "You can use Regular Expressions."

How to use them? What should I use for my case? Should it be something like ".+@163\.com"? If so, then why we can block individual emails using their string representation "as is", when the special regular expression meta-character "dot" isn't escaped (for instance, "aslifcskfad@163.com"), and it works?

Sponsor
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.1 BETA
10 years ago
Simply use

.*?@163.com
tecman
  • tecman
  • 100% (Exalted)
  • YAF All-the-Time Topic Starter
10 years ago
I understand why we may need the minimal +? quantifier instead of the greedy + quantifier though the latter should work too.

But why do we not prefix the 2nd dot (in ".com") using the backslash? Just dot works too, but to be precise, we need to specify exactly the dot character.

Or maybe I do not know something about a special regex engine you are using inside YAF?

tecman
  • tecman
  • 100% (Exalted)
  • YAF All-the-Time Topic Starter
10 years ago
My pattern .+?@163\.com does not work - dhgfdgkusg@163.com was able to register today.

Will try .+?@163.com now.

What a strange syntax... Or maybe I do not understand something 😉

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.1 BETA
10 years ago
Didnt look at the code but if i remember correctly the puncations are automatically escaped.

Be aware if you want to use banned emails/usernames you need to enable bot check in the host settings by setting the "Handling of Bots during Registration" to Block User

tecman
  • tecman
  • 100% (Exalted)
  • YAF All-the-Time Topic Starter
10 years ago
All this does not help - a user with the email dshfuhgssy@163.com was able to register on our forum yesterday.

Is it a bug in the forum engine?? Using YAF 2.1.2

tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.1 BETA
10 years ago
Sorry i was wrong you need to escape the punction

You need to use...

.*?@163\.com
tecman
  • tecman
  • 100% (Exalted)
  • YAF All-the-Time Topic Starter
10 years ago
A new spammer with the email slngel75@163.com registered today.

Guys, PLEASE, fix this issue with banning new users by email mask as I'm very tired of these spammers...

Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
10 years ago

A new spammer with the email slngel75@163.com registered today.

Guys, PLEASE, fix this issue with banning new users by email mask as I'm very tired of these spammers...

Originally Posted by: tecman 

did you try this and then restart the application?

Sorry i was wrong you need to escape the punction

You need to use...

.*?@163\.com

Originally Posted by: tha_watcha 

tecman
  • tecman
  • 100% (Exalted)
  • YAF All-the-Time Topic Starter
10 years ago
Yes, my last regexp to block was .*?@163\.com, but I hadn't restarted the forum.

It's very strange that we need to restart the web app. Let me try again with restart.

tecman
  • tecman
  • 100% (Exalted)
  • YAF All-the-Time Topic Starter
10 years ago
A related question: is there a log I can view to see what emails were banned using the email mask filter we are talking about?
Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
10 years ago

A related question: is there a log I can view to see what emails were banned using the email mask filter we are talking about?

Originally Posted by: tecman 

You didn't even try to find this lol :P

Admin > Spam Protection > Spam Event Log

That should tell you what you need to know.

tecman
  • tecman
  • 100% (Exalted)
  • YAF All-the-Time Topic Starter
10 years ago
You are laughing, but I do not have it in my YAF forum control panel (v2.1.2):
tha_watcha
  • tha_watcha
  • 100% (Exalted)
  • YAF.NET Project Lead 🤴 YAF Version: 4.0.1 BETA
10 years ago

You are laughing, but I do not have it in my YAF forum control panel (v2.1.2):

Originally Posted by: tecman 

The Spam Event log is available in 2.20. But all Spam log entries are also listed in the Main Event log under Admin -> Maintenance -> Event log

Zero2Cool
  • Zero2Cool
  • 100% (Exalted)
  • YAF Leader YAF Version: YAF 3.1.16
10 years ago

You are laughing, but I do not have it in my YAF forum control panel (v2.1.2):

Originally Posted by: tecman 

My mistake, I thought that Log was implemented earlier.