Gossamer Forum
Home : Products : DBMan : Customization :

prevent spam records

Quote Reply
prevent spam records
my database is a mailing list and i want to allow default user to add record (to be added to our list). i'm having problem with people or robots adding lots of spam type records such as debt consolidation, viagara, etc. then i have to manually delete all those records before i send out a mailing. any suggestions on preventing these records being added?
Quote Reply
Re: [delicia] prevent spam records In reply to
You could set up a flag to yourself with a list of keywords perhaps... I did something similar for a spam filter

if (textarea =~ /$spamfilter/) {
alert may be spam
}

I use a separate file called "spam.filter" and simply add "keywords" to it such as:
viagra
v1agra
cialis
college degree
hot stock

There are some email (address verification type of) mods for Perl as well, but I'm not sure if that helps you. You could add the CAPTCHA mod which requires the submitter to enter the text displayed on a picture before submitting - that may eliminate some of the robots...

I'd be happy to share the spam filter code if you'd like.
Quote Reply
Re: [Watts] prevent spam records In reply to
thanks, i'd like to see the code for the spam filter.
Quote Reply
Re: [delicia] prevent spam records In reply to
Here's the whole thing so you can play with it. The main thing is the spam.filter gets joined together into a variable

$filter = "viagra|v1agra|degree|free money"

and then it searches for a match and tag

if ($email =~ /$filter/i;) {
probably spam
}

It's fairly well commented and I used to run it from my xp machine, but the coding is amatuer-ish at best. Now I'd do a lot of thing differently, but it did work for me at the time. If nothing else it'll give you some keywords to search on.
Quote Reply
Re: [Watts] prevent spam records In reply to
You could create 5 images with a combination of letters and numbers (a fake captcha type of thing) and randomly display them and then filter on it. if ($in{'captcha'} =~ /501Gh32|0Yn87dE|blah|blah|blah/) {allow post} else {deny} -- this way you could have a field where the user has to enter what they see in the image and I doubt they'd ever know it's only 5 or so images total and thus only 5 or so combinations of "entry codes". At least it'd stop the spam bots.

I've also noticed that all of the "hot stock" emails I get are images embedded in the email and the source is something like <img src="cid:000b01c7149b..."> so you could filter on src="cid: since I can't think of a legitimate reason for "hiding" a url in this manner. That assumes you allow html code in your posts.