Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
1.1k views
in Plugins by

a.buseu.n.i.o.n.st.ar.l.imi.ted@gmail.com

a.b.u.seu.ni.on.s.tarli.m.it.ed@gmail.com

k.o.nov.akolit@gmail.com

k.ono.v.a.ko.li.t@gmail.com

ko.novak.o.l.it@gmail.com

All of these emails contains at least three dots (.)

I want to block the email address contains more than 3 dots

I'm currently using Registration Blocker by Ansgar Wiechers

Q2A version: v1.8.5
by
+1
Initially I had also tried this. But sad thing is the pattern keeps on changing. So I allowed only a few known domains which reduced spam 99%. With a bit of sophisticated pattern check we can generalize it but effort is needed.
by
Currently i only allowed gmail and I'm getting 5 to 8 spam user per day
by
+1
Yes. 5-8 is much better than 100-200 :) But are these spammers doing any harm? What we do is to make the first post approved by moderators. Then once in a while clean up all spam users.

4 Answers

+2 votes
by
selected by
 
Best answer

I've already planned to add a regular expression option to the plugin this upcoming weekend. Until then you can add the following lines to the file qa-registration-blocker.php as a quick fix (insert them below line 109):

if (preg_match("/(\..*){4,}@gmail\.com$/i", $email)) {
  return $this->translate('email_address_not_allowed');
}

by
+2
Version 1.6.0 has been released.
by
I'm using your new plugin with this regular expression as you mentioned
/(\..*){4,}@gmail\.com$/i
but getting this error
Warning: preg_match(): Unknown modifier '(' in C:\xampp\htdocs\Neet Overflow\qa-plugin\q2a-registration-blocker-1.6.0\qa-registration-blocker.php on line 263
by
Sorry I get it regular expression should be without starting "/" and ending "/i"

(\..*){4,}@gmail\.com$
by
edited by
+1
Yes. The slashes are just a technicality for preg_match(), so that you can specify modifiers along with the pattern (like "i" for a case-insensitive match). Having the user add that to every regex would be both tedious and error-prone, so the plugin already does it for you. All you need to do is enter the regular expressions by themselves (one per line).
The only downside is that it makes all matches case-insensitive, so you can't distinguish capitalized from non-capitalized localparts. However, I thought that was an acceptable tradeoff.
It would've been more consistent for PHP to make the function preg_match() accept modifiers as flags like PREG_UNMATCHED_AS_NULL, so that you wouldn't need to add the slashes around each expression, but alas that's not how PHP works.
0 votes
by
I've gotten the same pattern on my website
0 votes
by
It is not really an answer to your question.

But I use the Stop Spam plugin

And it has helped me to greatly reduce these types of events on my site.

It has not disappeared. But if it is less
0 votes
by
It is easy to use javascript code which allows only the emails given in pattern..

Like

@Gmail.com

@yahoo.com

@outloook.com

If someone type other email and Submit Javascripts code run and give messages to use only allowed emails..

Goto Google and search the code

I'm not a advanced user, i think any programmer can create this code in minutes...
by
We allready have it. You not get the point.
by
+1
Javascript is NOT a reliable method for this. Any spammer will bypass JS.
...