Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Small mod: Blocking forum email spam

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!
Before posting, make sure you have read this topic!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
ruirib Posted - 25 August 2006 : 07:09:30
Version 1.01 - 2006/08/25
Snitz forum version: 3.4.05


This mod will stop members emailing other forum members until they reach a given number of forum posts. It's useful to stop spammers who register just to send emails to forum members.

It's not a very elaborate mod, and the post limit must be changed in the code, but I'm providing it because with the current surge of spammers registering all over the place, it can be useful to avoid them annoying your valuable forum members.

It's even more interesting because it will allow the spammer to write the email and when the email is sent, it will show a message stating that it won't be sent, since the member does not have the required number of posts to send it. So, they'll have the trouble to compose the message only to be told it can't be sent, once that is tried.
It will also send a message to the forum admin, notifying him of the spam attempt, so that the member can be blocked.

Code changes to an unchanged pop_mail.asp:
Starting with a pop_mail.asp, at line# 46, add the following code:

'######## Email Spam Mod ############

if Request.QueryString("mode") = "DoIt" then
   Err_Msg = ""

   strSql = "SELECT M_NAME, M_POSTS FROM " & strMemberTablePrefix & "MEMBERS M"
   strSql = strSql & " WHERE M.MEMBER_ID = " & MemberID

   set rs = my_Conn.Execute (strSql)

   If Not rs.EOF then
      intMPosts = rs("M_POSTS")

      if intMPosts < 10 then
         Err_Msg = "<li>You don't have enough posts to email other members.</li>"
         	strSpammerName = RS("M_NAME")

         'Send email to forum admin
         strRecipients = strSender
         strFrom = strSender
         strFromName = "Automatic Server Email"
         strSubject = "Possible Spam Poster"
         strMessage = "There is a possible spam poster at " & strForumTitle & vbNewLine & vbNewLine
         strMessage = strMessage & "Member " & strSpammerName & ", with MemberID " & MemberID & ", has been trying to send emails to " & Request.Form("Name") & ", without having enough posts to be allowed to do it." & vbNewLine & vbNewLine 
         strMessage = strMessage & "Here are the message contents: " & VbNewLine & Request.Form("Msg") & vbNewLine & vbNewLine & vbNewLine & vbNewLine
         strMessage = strMessage & "This is a message sent automatically by the Spam Control Mod ;)."

%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
  
     
      end If

   End if

   rs.Close
end if
'############# End of email spam mod #############


Then at line# 102, where you have

if Request.QueryString("mode") = "DoIt" then
  Err_Msg = ""

comment the 2nd line, so that it will look like this:

if Request.QueryString("mode") = "DoIt" then
  'Err_Msg = ""

The commented line can also be removed, of course.

This has been tested with 3.4.05 and has been working well. If you need to change the number of messages a member must have before emailing other members, just change the number in red to the desired value.

If you need help with this, please post in the mod implementation forum.
<
15   L A T E S T    R E P L I E S    (Newest First)
leatherlips Posted - 22 June 2010 : 21:22:38
quote:
Originally posted by ruirib

It's an old one... It is even included in the latest Snitz version .

I have 3.4.05 with many updates so I never installed .07. Nevertheless, this mod is very useful!
ruirib Posted - 22 June 2010 : 17:55:32
It's an old one... It is even included in the latest Snitz version .
leatherlips Posted - 21 June 2010 : 12:52:23
Excellent MOD! I just had a new member sign up today and start sending spam pm's to several of my members. I added the code for the email and the pm and it works great! Thanks!
Jaeda Posted - 13 October 2008 : 20:40:57
quote:
Originally posted by ruirib

Hmmm... that's why I hate psting stuff without testing.

The new code should be like this:


'######## Email Spam Mod ############

if Request.QueryString("mode") = "DoIt" then
   Err_Msg = ""

   strSql = "SELECT M_NAME, M_POSTS FROM " & strMemberTablePrefix & "MEMBERS M"
   strSql = strSql & " WHERE M.MEMBER_ID = " & MemberID

   set rs = my_Conn.Execute (strSql)

   If Not rs.EOF then
      intMPosts = rs("M_POSTS")

      if intMPosts < 5 then
         Err_Msg = "<li>You don't have enough posts to email other members.<br>If you feel that you have received this message in error, please contact the forum administrator.</li>"
            strSpammerName = RS("M_NAME")

         rs.Close


         strSql = "SELECT M.M_NAME FROM " & strMemberTablePrefix & "MEMBERS M"
         strSql = strSql & " WHERE M.MEMBER_ID = " & intMemberID

         set rs = my_Conn.Execute (strSql)

         if rs.bof or rs.eof Then
           strDestName = ""
         Else
           strDestname = rs("M_NAME")
         End If

         rs.close
         Set rs = nothing

         'Send email to forum admin
         strRecipients = strSender
         strFrom = strSender
         strFromName = "Automatic Server Email"
         strSubject = "Possible Spam Poster"
         strMessage = "There is a possible spam poster at " & strForumTitle & vbNewLine & vbNewLine
         strMessage = strMessage & "Member " & strSpammerName & ", with MemberID " & MemberID & ", has been trying to send emails to " & strDestName & ", without having enough posts to be allowed to do it." & vbNewLine & vbNewLine
         strMessage = strMessage & "Here are the message contents: " & VbNewLine & Request.Form("Msg") & vbNewLine & vbNewLine & vbNewLine & vbNewLine
         strMessage = strMessage & "This is a message sent automatically by the Spam Control Mod ;)."

%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%


     end If
 
  Else
     rs.Close
     Set rs = nothing
  End If
   
   
end if
'############# End of email spam mod #############





okay I've done all of this... and it still lets the spam email go through to the member and it doesn't send a note to the spammer... any advise?<
CertGuard Posted - 28 April 2008 : 22:56:18
Hey ruirib,

I hope I'm not stepping on any toes here. I received an email from this mod (which is working great BTW)
and decided that the text version of the message did nothing for me, being that I have my forums setup
to send me HTML emails. So, I went through and started formatting the text, then decided to add a few
features to the message.

In this mod variation for HTML emails, I have only modifed the information starting on, or about, line #46
in the pop_mail.asp file.

New features:

  • Offender visible from Subject line

  • Increased legibility of all data

  • Link to offender's profile

  • Link to WHOIS information for offender's IP Address

  • Server Time

  • Offender's RAW Data

  • Link back to this thread so admins like me remember where to find info on it



'######## Email Spam Mod ############

if Request.QueryString("mode") = "DoIt" then
   Err_Msg = ""

   strSql = "SELECT M_NAME, M_EMAIL, M_POSTS FROM " & strMemberTablePrefix & "MEMBERS M"
   strSql = strSql & " WHERE M.MEMBER_ID = " & MemberID

   set rs = my_Conn.Execute (strSql)

   If Not rs.EOF then
      intMPosts = rs("M_POSTS")
      intRID = Request.Querystring("id")
			
			strSQL_x = "SELECT M_NAME FROM " & strMemberTablePrefix & "MEMBERS M"
   		strSql_x = strSql_x & " WHERE M.MEMBER_ID = " & intRID
   		
			set rs_x = my_Conn.Execute (strSql_x)
			
			If Not rs_x.EOF then
				R_Name = rs_x("M_NAME")
			end if
			rs_x.close
			
      if intMPosts < 10 then
         Err_Msg = "<li>You need more than " & intMPosts & " posts to send emails to other members. If you want to get someone's attention please just post it, we will not neglect you.</li>"
         	strSpammerName = RS("M_NAME")

         'Send email to forum admin
         strRecipients = strSender
         strFrom = strSender
         strFromName = "Automatic Server Email"
         strSubject = "Possible Spam Poster [" & strSpammerName & "]"
         strMessage = "<font style=""font-family: arial;"">" & vbNewLine & vbNewLine
         strMessage = strMessage & "There is a possible spam poster at " & strForumTitle & "<br />" & vbNewLine & vbNewLine
         strMessage = strMessage & "Member: <a href=""/forums/pop_profile.asp?mode=display&id=" & MemberID & """><b>" & strSpammerName & "(Member ID " & MemberID & ")</b></a><br />" & vbNewLine
         strMessage = strMessage & "  # of Posts: <b>" & intMPosts & "</b><br />" & vbNewLine
         strMessage = strMessage & "Intended Recipient: <b>" & R_Name & "(Member #" & intRID & ")</b><br />" & vbNewLine
         strMessage = strMessage & "Message: <br/><b>" & VbNewLine & replace(Request.Form("Msg"), vbNewLine, "<br />") & "</b><br />" & vbNewLine
         strMessage = strMessage & "<hr /><br />" & vbNewLine
         strMessage = strMessage & "Remote Address WHOIS: <a href=""http://whois.domaintools.com/" & Request.ServerVariables("remote_addr") & """>" & Request.ServerVariables("remote_addr") & "</a><br />" & vbNewLine
         strMessage = strMessage & "Server Time - (1/24): <b>" & Now()-(1/24) & "</b><br/>" & vbNewline
         strMessage = strMessage & "RAW DATA: <b>" & Request.ServerVariables("ALL_RAW") & "</b><br />" & vbNewline
         strMessage = strMessage & "<hr /><br />" & vbNewLine
         strMessage = strMessage & "This is a message sent automatically by the <a href=""http://forum.snitz.com/forum/topic.asp?TOPIC_ID=62640"">Spam Control Mod</a>."
				 strMessage = strMessage & "</font>"
%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%
  
     
      end If

   End if

   rs.Close
end if
'############# End of email spam mod #############
<
RhinoOffRoad Posted - 14 April 2008 : 00:40:38
ruirib,
thank you very much sir, this mod is exactly what i was looking for. im so tired of these one-hit monkeys joining my board and emailing all my members only to get 100 posts (on the concealedcarryforum.com particularly) on the spam mails the members were getting. thanks again!<
ruirib Posted - 13 January 2008 : 19:51:38
Glad you like it.<
Doughnut Posted - 13 January 2008 : 19:46:14
Thanks for this...superb mod..!!
This'll save so many headaches <
ruirib Posted - 13 November 2007 : 10:25:55
You're welcome.<
kmac Posted - 13 November 2007 : 10:20:10
That does it. Thanks for all your help!

Ken<
ruirib Posted - 13 November 2007 : 10:09:06
Hmmm... that's why I hate psting stuff without testing.

The new code should be like this:


'######## Email Spam Mod ############

if Request.QueryString("mode") = "DoIt" then
   Err_Msg = ""

   strSql = "SELECT M_NAME, M_POSTS FROM " & strMemberTablePrefix & "MEMBERS M"
   strSql = strSql & " WHERE M.MEMBER_ID = " & MemberID

   set rs = my_Conn.Execute (strSql)

   If Not rs.EOF then
      intMPosts = rs("M_POSTS")

      if intMPosts < 5 then
         Err_Msg = "<li>You don't have enough posts to email other members.<br>If you feel that you have received this message in error, please contact the forum administrator.</li>"
            strSpammerName = RS("M_NAME")

         rs.Close


         strSql = "SELECT M.M_NAME FROM " & strMemberTablePrefix & "MEMBERS M"
         strSql = strSql & " WHERE M.MEMBER_ID = " & intMemberID

         set rs = my_Conn.Execute (strSql)

         if rs.bof or rs.eof Then
           strDestName = ""
         Else
           strDestname = rs("M_NAME")
         End If

         rs.close
         Set rs = nothing

         'Send email to forum admin
         strRecipients = strSender
         strFrom = strSender
         strFromName = "Automatic Server Email"
         strSubject = "Possible Spam Poster"
         strMessage = "There is a possible spam poster at " & strForumTitle & vbNewLine & vbNewLine
         strMessage = strMessage & "Member " & strSpammerName & ", with MemberID " & MemberID & ", has been trying to send emails to " & strDestName & ", without having enough posts to be allowed to do it." & vbNewLine & vbNewLine
         strMessage = strMessage & "Here are the message contents: " & VbNewLine & Request.Form("Msg") & vbNewLine & vbNewLine & vbNewLine & vbNewLine
         strMessage = strMessage & "This is a message sent automatically by the Spam Control Mod ;)."

%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%


     end If
 
  Else
     rs.Close
     Set rs = nothing
  End If
   
   
end if
'############# End of email spam mod #############
<
kmac Posted - 13 November 2007 : 09:45:16
Update - it is sending the spam warning email to the admin, and the content looks good. It's just not returning the "you don't have enough posts" page on the spammer's "send" click<
kmac Posted - 13 November 2007 : 09:03:09
Hi ruirib,

When I try to send the email, I get this error message -
...........
Microsoft VBScript runtime error '800a01a8'

Object required: 'rs'

/forum/pop_mail.asp, line 99
........

My new post_mail file is here - http://www.bluemoonfabrications.com/pop_mail2.txt

Thanks, Ken<
ruirib Posted - 13 November 2007 : 08:42:21
The mod was written for Snitz 3.4.05. Snitz 3.4.06 changed pop_mail.asp and it does not include some form fields that were available with Snitz 3.4.05. Getting the destination member name will require another DB query. Here is the code for the initial mod part, required to have it working with 3.4.06:

'######## Email Spam Mod ############

if Request.QueryString("mode") = "DoIt" then
   Err_Msg = ""

   strSql = "SELECT M_NAME, M_POSTS FROM " & strMemberTablePrefix & "MEMBERS M"
   strSql = strSql & " WHERE M.MEMBER_ID = " & MemberID

   set rs = my_Conn.Execute (strSql)

   If Not rs.EOF then
      intMPosts = rs("M_POSTS")

      if intMPosts < 5 then
         Err_Msg = "<li>You don't have enough posts to email other members.<br>If you feel that you have received this message in error, please contact the forum administrator.</li>"
            strSpammerName = RS("M_NAME")
		
        rs.Close


		strSql = "SELECT M.M_NAME FROM " & strMemberTablePrefix & "MEMBERS M"
        strSql = strSql & " WHERE M.MEMBER_ID = " & intMemberID

         set rs = my_Conn.Execute (strSql)

		 if rs.bof or rs.eof Then
			strDestName = ""
		 Else
		    strDestname = rs("M_NAME")
		 End If

        rs.close
        Set rs = nothing
 
         'Send email to forum admin
         strRecipients = strSender
         strFrom = strSender
         strFromName = "Automatic Server Email"
         strSubject = "Possible Spam Poster"
         strMessage = "There is a possible spam poster at " & strForumTitle & vbNewLine & vbNewLine
         strMessage = strMessage & "Member " & strSpammerName & ", with MemberID " & MemberID & ", has been trying to send emails to " & strDestName & ", without having enough posts to be allowed to do it." & vbNewLine & vbNewLine
         strMessage = strMessage & "Here are the message contents: " & VbNewLine & Request.Form("Msg") & vbNewLine & vbNewLine & vbNewLine & vbNewLine
         strMessage = strMessage & "This is a message sent automatically by the Spam Control Mod ;)."

%>
<!--#INCLUDE FILE="inc_mail.asp" -->
<%


      end If

   End if

   rs.Close
end if
'############# End of email spam mod #############


Don't forget that there is another change required for the mod, as per the original post.

I haven't tested this, but it should work.<
kmac Posted - 13 November 2007 : 08:04:34
Thanks for looking!

http://www.bluemoonfabrications.com/pop_mail.txt<

Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000 Version 3.4.07