Recently over at the site we’ve been being hit by comment spammers creating fake accounts and trying to make posts. They aren’t very smart because the fake accounts they create have names of randomly generated letters and numbers that stand-out like sore-thumbs. They also always use fake email addresses so they can never validate their accounts (and thus are never able to post anything). But the really stupid thing is that they always use a .CN (China) domain in their fake email addresses.
I had been manually deleting these accounts but after doing this 300 or 400 times I decided I had better things to do (like watching The Office) so I found a way to permanently block these particular spammers altogether by creating a Drupal Access Role to block all email address that end in .CN .. Now I know what you’re saying – you’re saying “But Randy, what about all your Chinese members?!” – Well, they’re just going to have to buck-up and get GMail accounts. It’s sad how just a few dirty spammers can ruin it for an entire country.
How To Create an Access Control Rule In Drupal:
It’s really pretty simple. In the Administration menu find Access Control, then Access Rules and hit Add Rule.
For the type select “Deny”, and rule type select “e-Mail”. Then in the Mask field, enter:
% is a wildcard, and the .cn is the TLD for China.. You could replace the % with “_” to mask out particular characters or use just about any combination to block out just about anything you want.
That’s how I was able to block all the dirty Chinese spammers in less than 40 seconds and go back to watching the adventures of Michael Scott, Jim and Pam …