Dealing with comment spam

Note: This is an old post in a blog with a lot of posts over a long span of time. The world has changed, technologies have changed, and I've changed. It's likely this is out of date, the code doesn't work, the ideas haven't aged well, or the ideas were terrible to begin with. Let me know if you think this is something that needs updating.

Someone spammed my blog with 400+ comments for some shoes site. Took me less than 2 minutes to skim the emails, see the pattern, and then remove all the spam from my comments moderator queue. This sort of thing is the big strength of PyBlosxom.

I have my blog set up to store comments as individual text files in a comments/ directory. All comments have to be approved before they make it to the site. Approved comments end in .cmt and comments in the moderator queue end in .cmt-. Additionally, comments that contain one of a series of blacklisted words are rejected automatically. Any time someone posts a comment, I get an email.

It took me a minute to skim my 400+ emails and notice they're all kind of the same, 10 seconds to update the blacklist so that I won't get any additional comments like this in the future, and 10 seconds to remove all the spam from the queue with:

for mem in `grep -rl spamwordhere *`; do rm $mem; done

That was it--spam gone in less than 2 minutes. Took longer to write the blog post about it.

Want to comment? Send an email to willkg at bluesock dot org. Include the url for the blog entry in your comment so I have some context as to what you're talking about.