MOD: anti-spam E-mail filter - Posted (16485 Views)
Retired Support Moderator
MarcelG
Posts: 2625
2625

version 1.1 - updated 03-09-2005

Here's a quick and simple mod I came up with after reading some topics here about spam some people received on their board created by autoregistration bots that succesfully get past the e-mail validation part.
It's a very simple mod, which simply dissallows certain e-mail domains from registering.
File to alter: Register.asp (be sure to backup first!)
Find this code:
Code:
		If strAutoLogon <> 1 then
if Request.Form("Email") = "" then
Err_Msg = Err_Msg & "<li>You Must give an e-mail address</li>"
end if
Code:
if (Instr(lcase(Request.Form("Email")), "@gmailinator.com") > 0) or _
(Instr(lcase(Request.Form("Email")), "@dodgeit.com") > 0) or _
(Instr(lcase(Request.Form("Email")), "@spamgourmet.com") > 0) or _ (Instr(lcase(Request.Form("Email")), "@spamhole.com") > 0) or _
(Instr(lcase(Request.Form("Email")), "@jetable.org") > 0) or _
(Instr(lcase(Request.Form("Email")), "@bumpymail.com") > 0) or _
(Instr(lcase(Request.Form("Email")), "@mytrashmail.com") > 0) or _
(Instr(lcase(Request.Form("Email")), "@u-yep.com") > 0) then
Err_Msg = "<li>Registration with an e-mail address from that domain is not possible!</li>" & Err_Msg
end if
As you can see I've already taken the liberty to add some domains for blacklisting. cool (including u-yep.com, and some fake mailservices such as dodgeit.com and mailinator.com)
When people try to register with any e-mail address from the domains listed, they get the message that that is not possible.
In order to add your own domains to block, simply copy the red line, and insert it inbetween the rest. Change the @spamgourmet.com domain into the domain you wish to block, and repeat for each and every domain you wish to block. Now your ready to go.
(This mod can also be used the other way around ; e.g. allowing registration only from the mentioned domains, and excluding all domains not mentioned. Simply change all instances of > 0 into = 0 and you're done.)
Any improvement/suggestion/etc is welcome!

Update

The code below also restricts already registered users from changing their e-mail address to any blacklisted address.
Find both instances of this line in pop_profile.asp:
Code:
if Request.Form("Email") = "" then
Directly above each instance add this code:
Code:
if (Instr(lcase(Request.Form("Email")), "@gmailinator.com") > 0) or _
(Instr(lcase(Request.Form("Email")), "@dodgeit.com") > 0) or _
(Instr(lcase(Request.Form("Email")), "@spamgourmet.com") > 0) or _(Instr(lcase(Request.Form("Email")), "@spamhole.com") > 0) or _
(Instr(lcase(Request.Form("Email")), "@jetable.org") > 0) or _
(Instr(lcase(Request.Form("Email")), "@bumpymail.com") > 0) or _
(Instr(lcase(Request.Form("Email")), "@mytrashmail.com") > 0) or _
(Instr(lcase(Request.Form("Email")), "@u-yep.com") > 0) then
Err_Msg = "<li>The e-mail domain you supplied is blacklisted at this board, and cannot be used!</li>" & Err_Msg
end if
Again, if you wish to add your own blacklisted domains, paste a copy of the red line in the code, and change the address.<
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Starting Member
Joebobby
Posts: 3
3
I just installed 3.4.07 primarily hoping to be able to combat the spammers that are pummeling my site with spam. The spam that gets through is one issue and all of the bogus, newly-registered members are another. There are two things that I think would be very effective at combating them for my site. I've seen both of these things mentioned here in the Snitz forums, but the explanation for implementing the first option is not clear to me and I can't for the life of me find the threads that discussed potential ways of implementing the second option.
  • The first, simple solution to spammers on my site is the blocking of entire country codes (e.g. *.ru, *.pl, *cn). This is not an issue for my site's user-base because it is a regionally-focused site. In this thread above there is discussions RE: the implementation of this, including the display of a snippet of code. However, there isn't much explanation regarding where this code should be placed - it's not even clear to me in which file it should go, much less at which line. This is made more complex because my understanding is that this anti-spam e-mail MOD has been incorporated into 3.4.07, but I don't know how it was incorporated (e.g. using the code referred to in this thread, or by the creation of separate .asp files or by the use of a d'base somewhere). I have added some e-mail domains to the filter in 3.4.07 and it's working well for specific domains, but for example, it does not recognize wildcards '*', so entering the domain '@*.ru' accomplishes nothing. Could someone tell me if the code for banning entire nation codes (and *.info while you're at it) can be incorporated into 3.4.07 - and if so, please tell me in which file and before or after which lines of code it should be placed?
  • (right(lcase(Request.Form("Email")),5)=".info") or _

    the number show the chars that are in the string
    .info = 5
    .biz = 4
    .ru = 3<

  • The second potential solution would be to add code that prevents the registration of users who use the same last name and first name. Really, about 99.9% of the spammers on my site do this - I assume they are probably using a 'bot to automate this process? I tried to search this forum a bunch of times but couldn't find the threads dealing with this again. If someone knows what I'm referring to and can tell what code to insert where and into which file (of 3.4.07) I would be greatly indebted to him.
Kind regards,

Joebobby
You Must enter a message