Skip to Content Skip to Menu

Regex for the AntiSpam block lists

  • GUEST
9 years 6 months ago - 9 years 6 months ago #263348 by
I can not find any docs on using regex's for block lists, other than it is possible, nor do any of the common styles of regex work.

In Perl regex style, I want to ban these domains: /.*\.info\.pl/
How do I describe this in this module?
Last edit: 9 years 6 months ago by .

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
9 years 6 months ago #263381 by krileon
Replied by krileon on topic Regex for the AntiSpam block lists
It doesn't support regex. The description doesn't say it does. To block a domain you need to set the block type to Email Domain then supply the domain as info.pl.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • GUEST
9 years 6 months ago - 9 years 6 months ago #263417 by
I get infinite variations of subdomain for the domain info.pl ("aa.info.pl", "bb.info.pl", etc..) and these can currently only be caught if the entire email domains "aa.info.pl", "bb.info.pl" ad nauseum are defined. This is one example case, I have attackers who use this subdomain obfuscation trick on other domains too.

What prevents you from using a regex comparisson in MySQL instead of a direct string comparisson?
Last edit: 9 years 6 months ago by .

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48478
  • Thanks: 8282
  • Karma: 1443
9 years 6 months ago #263452 by krileon
Replied by krileon on topic Regex for the AntiSpam block lists
The way it works is it splits by @ and takes the second half (domain) and checks the blocks database table to see if the domain has been blocked. If it has it'll block it.

What prevents you from using a regex comparisson in MySQL instead of a direct string comparisson?

It's slow. It can't be indexed. The regexp has to be MYSQL formatted, not PHP formatted, which makes it subject to massive user error (e.g. your regex above would not work; MYSQL doesn't need delimiters and you need to double backslash). Would entirely break B/C (the current usage would not work 1:1 if it was changed to regex). There's many more reason why it's not using REGEX to do the matching.

The best way to support what you're wanting is to change the matching from being done in the query to being done PHP side, which will slow it down, but it eliminates the problems above. The problem with this is I'd need to completely rewrite most of the blocking behavior. I've added a feature ticket for this, but no idea when I'll get around to implementing it as at this time CB Activity and GJ have my focus.

forge.joomlapolis.com/issues/5263


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • GUEST
9 years 6 months ago #263471 by
I appreciate the complexity and unintended side effects of implementing something like this.

A compromise might be to compare on a MySQL 'like' (using wild card markers '*' on the UI and replacing with '%' at query time). Not too bad on indexing and far less prone to user error. Even that would solve the problem that I have! :-)

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum