vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=34)
-   -   vbSpamBuster v0.2 (https://vborg.vbsupport.ru/showthread.php?t=76756)

-=Sniper=- 12-20-2005 11:27 PM

UK Jimbo; would love to see a 3.5.2 version :)

UK Jimbo 12-21-2005 01:00 AM

Sorry a v3.5.x version hasn't materialised yet.

I'm on an extended overseas trip at the moment and it's hard to find the time for it. It's definitely on my TODO list :)

Ski-Whiz 12-21-2005 11:34 AM

Can this sort of thing also be added to the PM system? We are getting people who are trying to be sneaky, and pm members through the pm system as well.

Unless members come forward and tell you, the site won't know about it.

So adding a checker in the pm system would be great!

Thanks!

motorhaven 12-21-2005 01:33 PM

Here you go....

In spambuster-libs.php, look for this at the bottom of the file:

Code:

?>
Above it, add:

Code:

        // used to perform the test on emails/pms
        function sb_test2($title,$body,$recip="")
    {
                $hits=array();

                // no need to worry about most posts
                if( $GLOBALS['bbuserinfo']['posts'] > SB_MIN_POSTS )
                        return false;

                // parts of the post
                $req['title'] = $title;
                $req['body'] = $body;
                $req['any'] = $title ."\n". $body;

                // fetch the list of tests
                $tests = sb_parse_config(SB_CONFIG);

                // run each test
                foreach($tests as $test) {

                        $test_pass=false;
                        // regular expression test
                        if( $test['type'] == 'regexp' ) {
                                $test_pass=preg_match($test['data'][0],$req[ $test['field'] ]);
                        }

                        // record the test if it was a hit
                        if( $test_pass ) {
                                $hits[ $test['name'] ] = $test['score'];
                                $hits['total'] += $test['score'];
                        }
                }

                // it isn't spam
                if( $hits['total'] < SB_TRIGGER )
                        return false;

                $ret=array();
                $ret['hits'] = $hits;

                // build a pretty string of the scores
                $pairs=array();
                foreach($hits as $k => $v) {
                        if( $k == 'total' )
                                continue;

                        $pairs[] = "$k=$v";
                }
                $ret['HITS_STR'] = implode(', ',$pairs);

                $ret['USER'] = $GLOBALS['bbuserinfo']['username'];
                $ret['MESSAGE_TITLE'] = $title;
                $ret['MESSAGE_BODY'] = $body;
        $ret['RECIP'] = $recip;

                // send alert emails
                sb_send_mail2($ret);

                return true;
        }


        function sb_send_mail2($vars) {

                $mail=array();
                $mail[] = "This is an automated email from vB SpamBuster";
                $mail[] = "";
                $mail[] = "The user <%USER%> has just tried to email or PM the following message to <%RECIP%>:";
                $mail[] = "";
                $mail[] = "***********************************************";
                $mail[] = "";
                $mail[] = "The vB SpamBuster system deemed it to be spam after it passed the following tests:";
                $mail[] = "<%HITS_STR%>";
                $mail[] = "";

                $msg = implode("\n",$mail);

                foreach($vars as $k => $v) {
                        $msg = str_replace("<%$k%>",$v,$msg);
                }

                $emails = explode(' ',SB_ALERT_EMAILS);
                foreach($emails as $email) {
                        vbmail($email,'vB SpamBuster PM or Email Alert',$msg);
                }
        }

(Note, I don't include the message title/body in the alert due to privacy issues.

In private.php, look for:

Code:

                                $title = addslashes(htmlspecialchars_uni(fetch_censored_text($pm['title'])));
                                $message = addslashes(fetch_censored_text($pm['message']));
                                $signature = intval($pm['signature']);
                                $iconid = intval($pm['iconid']);
                                $disablesmilies = iif($pm['disablesmilies'], 0, 1);

Below that add:

Code:

                // 11-26-2005: see if message passes spam trap filters
                if ( sb_test2( $title, $message, implode(' ', array_keys($sendto) ) ) )
                {
                                    // fails spam test
                }
                else
                {

Next, look for

Code:

                        }

                        $url = "private.php?$session[sessionurl]";
                        eval(print_standard_redirect('pm_messagesent'));

Change it to

Code:

                        }
                        }

                        $url = "private.php?$session[sessionurl]";
                        eval(print_standard_redirect('pm_messagesent'));


In sendmessage.php look for (towards the bottom of the file):

Code:

eval(fetch_email_phrases('usermessage', $destuserinfo['languageid']));
Below that add:
Code:

        // Test against spam trap filters
            if ( sb_test2( $emailsubject,$message, $destuserinfo['email'] ) )
        {
            // Message fails filters...
          // parse this next line with eval:
          $sendtoname = $destuserinfo['username'];
          eval(print_standard_redirect('redirect_sentemail'));
          return;
        }


oldengine 01-02-2006 12:54 PM

This is a great idea, but needs one modification.

Spam traps are not a "one shoe fits all" word list. The type of spam we tolerate posted on the board may be different than the spam words tolerated in emails. Therefore, a different spambuster-rules.php will be needed for the email spam.

There are items placed in my spambuster-rules.php that I would rather users communicate by email to eachother instead of in the open for all board readers to see. Copying spambuster-rules.php to spambuster-mail-rules.php and altering the contents would get the job done.

Hey! I'm waiting to upgrade to 3.5 because of SpamBuster!
EDIT: No longer. 3.5.3 is installed.

UK Jimbo 02-28-2006 01:01 AM

I've finally found the time to sort this out. 90% of the code is ready now and there'll be a beta release that just uses plugins and admincp configuration in the next few days.

UK Jimbo 03-02-2006 01:28 AM

Beta v3.5.x version here


All times are GMT. The time now is 07:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01204 seconds
  • Memory Usage 1,751KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete