| Author |  Topic  | 
              
                | ruiribSnitz Forums Admin
 
      
 
                Portugal26364 Posts
 | 
                    
                      |  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.
 <
 |  
                      | 
 Snitz 3.4 Readme | Like the support? Support Snitz too
 |  | 
              
                | NertzJunior Member
 
   
 
                Canada341 Posts
 | 
                    
                      |  Posted - 25 August 2006 :  08:01:20     
 |  
                      | Excellent Rui, thanks! Great timing too... I was trying to find time to do something like this. 
 cheers,
 Nat<
 |  
                      | Sadly, most Family Court Judges wrongfully reward opportunistic gold diggers
 that use our children unjustly as "instruments" of power.
 
 www.fathers-4-justice-canada.ca
 |  
                      |  |  | 
              
                | ruiribSnitz Forums Admin
 
      
 
                Portugal26364 Posts
 |  | 
              
                | borgeJunior Member
 
   
 
                Norway185 Posts
 | 
                    
                      |  Posted - 25 August 2006 :  14:11:34     
 |  
                      | It's not working on my 3.4.03< |  
                      | borge
 |  
                      |  |  | 
              
                | AnonJrModerator
 
      
 
                United States5768 Posts
 | 
                    
                      |  Posted - 25 August 2006 :  14:16:59       
 |  
                      | What specifically is the problem/error?< |  
                      |  |  | 
              
                | borgeJunior Member
 
   
 
                Norway185 Posts
 | 
                    
                      |  Posted - 25 August 2006 :  14:23:35     
 |  
                      | I do not get any error message, it just ignores the mod and lets me post with a 0 post count 
 The 100 characters mod worked fine though<
 |  
                      | borge
 |  
                      |  |  | 
              
                | borgeJunior Member
 
   
 
                Norway185 Posts
 | 
                    
                      |  Posted - 25 August 2006 :  14:28:38     
 |  
                      | It is actually notsending the possible spam e-mail, and gives a notice "E-mail has been sent". It fails to display the "You don't have enough posts to email other members" message,but does the joband sends the spam. It sends a waring to forum admin about possible spam.< |  
                      | borge
 |  
                      | Edited by - borge on 25 August 2006  14:40:58
 |  
                      |  |  | 
              
                | AnonJrModerator
 
      
 
                United States5768 Posts
 | 
                    
                      |  Posted - 25 August 2006 :  14:41:09       
 |  
                      | hmm.. I wonder if there is a problem with the two working together; I wouldn't think so though. I almost think thats even better - let the spammer's think the e-mail was sent when it wasn't. The only problem is that it hurts the real members who want to send an email with fewer than the required posts since it does tell them it went through when it actually didn't. =/ 
 Edit: you had to go and edit it while I was typing a reply!
  So it is sending the e-mail?< |  
                      | Edited by - AnonJr on 25 August 2006  14:42:29
 |  
                      |  |  | 
              
                | borgeJunior Member
 
   
 
                Norway185 Posts
 | 
                    
                      |  Posted - 25 August 2006 :  14:50:42     
 |  
                      | Yes, sorry, I notised the e-mails came in with a little delay. It is actually sending the e-mails, however I should probably say the messages were sent to a forum moderator account, hmmm...would it make a difference when sent to an ordinary member? I'll have to do more testing.< |  
                      | borge
 |  
                      |  |  | 
              
                | ruiribSnitz Forums Admin
 
      
 
                Portugal26364 Posts
 |  | 
              
                | AnonJrModerator
 
      
 
                United States5768 Posts
 | 
                    
                      |  Posted - 25 August 2006 :  15:00:21       
 |  
                      | The code rui posted looks like it doesn't care who is sending it or to whom it is going... I suspect it won't make a difference. Then again, I haven't really played with pop_mail.asp too much either... 
 Maybe a txt version of pop_mail.asp and inc_mail.asp would help...
 
 Edit: rui, you beat me again.
  < |  
                      | Edited by - AnonJr on 25 August 2006  15:01:54
 |  
                      |  |  | 
              
                | ruiribSnitz Forums Admin
 
      
 
                Portugal26364 Posts
 | 
                    
                      |  Posted - 25 August 2006 :  15:02:53     
 |  
                      | quote:Originally posted by AnonJr
 
 The code rui posted looks like it doesn't care who is sending it or to whom it is going...
 Edit: rui, you beat me again.
  
 
 
 Quite so... in both counts
  .< |  
                      | 
 Snitz 3.4 Readme | Like the support? Support Snitz too
 |  
                      |  |  | 
              
                | ruiribSnitz Forums Admin
 
      
 
                Portugal26364 Posts
 | 
                    
                      |  Posted - 25 August 2006 :  15:34:06     
 |  
                      | You have an error in pop_mail.asp. Where now you have this at line# 77 
 
else
	intMemberID = 0
end if
 You should cut these lines and move them to around line number# 47, so that the code, starting at line# 46 looks like this:
 
 
if Request.QueryString("ID") <> "" and IsNumeric(Request.QueryString("ID")) = True then
	intMemberID = cLng(Request.QueryString("ID"))
else
	intMemberID = 0
end if
'######## Email Spam Mod ############
< |  
                      | 
 Snitz 3.4 Readme | Like the support? Support Snitz too
 |  
                      |  |  | 
              
                | borgeJunior Member
 
   
 
                Norway185 Posts
 | 
                    
                      |  Posted - 25 August 2006 :  15:52:34     
 |  
                      | Fixed the code as suggested but still it is not working. I updated the txt file too if you like to check.< |  
                      | borge
 |  
                      |  |  | 
              
                | ruiribSnitz Forums Admin
 
      
 
                Portugal26364 Posts
 |  | 
              
                | borgeJunior Member
 
   
 
                Norway185 Posts
 | 
                    
                      |  Posted - 25 August 2006 :  17:59:46     
 |  
                      | It works now  Thanks!!!<
 |  
                      | borge
 |  
                      |  |  | 
              
                
                |  Topic  |  |