Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
vBouncer (PHP): reduce server load by unsubscribing bouncing members from threads Details »»
vBouncer (PHP): reduce server load by unsubscribing bouncing members from threads
Version: 1.2, by tamarian tamarian is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 06-25-2005 Last Update: 08-28-2005 Installs: 19
Code Changes Additional Files  
No support by the author.

There's also a vB 3.5 version: https://vborg.vbsupport.ru/showthrea...threadid=83486

vBouncer is a handy tool for busy forums (or those that do not require email verification) to control the amounts of bogus emails sent from and to your server. This was initially released for vB 2.x and vB 3.0.x as a Perl script, and is now fully integrated with vB as scheduled tasks with admin panel control.

What vBouncer does: vBouncer monitors your mail spool file, and identifies members responsible for large amounts of bounced emails. It then issues a PM warning, and when the unsubscribe threshold is met, it will will unsubscribe them for all threads, and sets them to the "no email" subscription level.

After a couple of runs, this should significantly reduce your server load.

Features:
Manual or auto processing option
Collect logs via IMAP/POP or mail spool file
Uses vB's cron files (Scheduled tasks)
Custom filters to match patterns in bounced emails
Encryption header to authenticate bounces.
Stats on members with bouncing emails, and error codes
Tuning options
Verbose cron logs for diagnostics
Option to send PM warning prior to reaching the limit
Option to send PM notifications after reaching the limit
Option to change the member's subscription default
Option to all thread subscriptions to "no email"
Option to all forum subscriptions to "no email"
Option to move offenders to a different primary usergroup
Option to process 5.0.0/550 errors (email unknown) upon a single email, isntead of observing the bounce limit

Installation:
1. Extract the files into the corresponding directories (admincp => admincp, includes/cron => includes/cron)
2. Run the installation script in the admincp
3. Fill out the settings menu in the vBouncer section of the admin panel (see the how-to post below)
4. Edit includes/mail.php
Find:
PHP Code:
if ($minusf)
        {
            
$this->success = @mail($toemail$subject$messagetrim($headers), "-f $fromemail");
        }
        else
        {
            
$this->success = @mail($toemail$subject$messagetrim($headers));
        } 
Replace with:
PHP Code:
global $vboptions;
                if (
is_valid_email($vboptions['vbouncer_spool_account'])) {
                        if (
$vboptions['vbouncer_header_return_key'])
                                
$headers .= 'X-Return-ID: ' md5($vboptions['vbouncer_header_return_key'] . $toemail) . "\n";
                        
$this->success = @mail($toemail$subject$messagetrim($headers), '-f' $vboptions['vbouncer_spool_account']);
                }
                else
                        
$this->success = @mail($toemail$subject$messagetrim($headers), "-f $fromemail"); 
In admincp/index.php, find:
PHP Code:
                                  if (can_administer('canadmincron')) 
Add before::
PHP Code:
                          if (can_administer('canadmincron'))
    {
        
construct_nav_option('vBouncer Settings''options.php?do=options&dogroup=vBouncer''|');
        
construct_nav_option('Stats''vbouncer.php?do=stats''<br />' );
        
construct_nav_option('Diagnostics''vbouncer.php?do=diag''<br />');
        
construct_nav_group('vBouncer');
    } 
5. Once ready, add the cron scripts to your scheduled tasks: vbouncer-collect.php (should be run daily, or more frequently) and vbouncer-clean.php (weekly, equal to Bounce limit period)

Change log:

- July 11, 2005 v1.2 Bug fix for some server/PHP setups; resolve aliases for return keys, otherwise some aliases would be considered forged.

- July 5, 2005 v1.1 Bug fix in standard report pattern matching

- July 4, 2005 v1.0 Added encrypted header for authentication (suggested by Paul M).

- July 3, 2005 v0.9.1 added fixed a bug preventing IMAP/POP log collection.

- July 2, 2005 v0.9 added IMAP/POP option and custom filters file vbouncer.ini

- June 27, 2005 v0.51 for 3.0.7 Corrected installer file.

- June 27, 2005 v0.5 for 3.0.7 Add setting for custom header strings.

- June 26, 2005 v0.2 for 3.0.7 Initial release No changes, just removed the plugin

Screenshots from 3.5 beta, but it looks the same on 3.0.7...

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #72  
Old 07-06-2005, 12:22 AM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jb605
I tried to compile PHP directly with compilation option --with-imap and --with-imap-ssl, but got this error:

configure: error: Cannot find rfc822.h. Please check your IMAP installation.

Looks like it is missing the header file. Not sure if I install c-client will resolve it. I am a little hesitate to install c-client because the installation file tells me it is a daemon service, but my server already has imap and pop daemon service.
You can install c-client, but you don't have to run it.
Reply With Quote
  #73  
Old 07-06-2005, 12:44 AM
jb605 jb605 is offline
 
Join Date: Feb 2004
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tamarian
You can install c-client, but you don't have to run it.
I am trying to install c-client. I have ran the make command (I am on linux)

make slx

But after that, I cannot find a make install command. And the rest part of the README file really deals with installing the binaries as a daemon service, nothing really about library installation.

If I went ahead to compile php with --with-imap=/usr/local/imap-2004e (which is the folder i created following instructions from php.net), then I got the above error:

configure: error: Cannot find rfc822.h. Please check your IMAP installation.
Reply With Quote
  #74  
Old 07-06-2005, 12:51 AM
jb605 jb605 is offline
 
Join Date: Feb 2004
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jb605
I am trying to install c-client. I have ran the make command (I am on linux)

make slx

But after that, I cannot find a make install command. And the rest part of the README file really deals with installing the binaries as a daemon service, nothing really about library installation.

If I went ahead to compile php with --with-imap=/usr/local/imap-2004e (which is the folder i created following instructions from php.net), then I got the above error:

configure: error: Cannot find rfc822.h. Please check your IMAP installation.
Just found that the following tips helped me to get rid of this compilation error:

Code:
cp c-client/c-client.a /usr/local/lib/libc-client.a
chmod 644 /usr/local/lib/libc-client.a
cp c-client/c-client.h c-client/rfc822.hc-client/mail.h \
    c-client/linkage.h /usr/local/include/
chmod 644 /usr/local/include/c-client.h /usr/local/include/rfc822.h \
    /usr/local/include/linkage.h /usr/local/include/mail.h
Found at http://dovecot.org/pipermail/dovecot...ly/004281.html
Reply With Quote
  #75  
Old 07-06-2005, 01:03 AM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good to hear jb605 :up:
Reply With Quote
  #76  
Old 07-08-2005, 04:40 PM
jb605 jb605 is offline
 
Join Date: Feb 2004
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did a mass email, and there are a large amount of bounced emails. I didn't notice that 50 count limit, so vbouncer went ahead and processed 50 unique emails, and deleted all the others. This is really bad because I do need all those bounced emails and need to process them all. Now they are gone, even if I raise the limit, I don't have those bounced emails anymore.

Also, vbouncer seems to delete emails that it cannot identify as returned error etc. It probably should leave those emails there, because I need to modify the vouncer.inc based on the patterns on those bounced emails. I guess it might be better if vbouncer only deletes emails it has read (in imap mode). I am not sure if it is possible with system file based method or pop mode.
Reply With Quote
  #77  
Old 07-08-2005, 05:11 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

vBouncer must delete the emails after processing, otherwise it will count them as duplicates on the next run. If you get too many bounced emails on every run, just increase the frequency of the collection task, as explained in the first post. If you really need to save copies of your bounced emails, just create a cron job to copy the file for you.
Reply With Quote
  #78  
Old 07-08-2005, 11:24 PM
jb605 jb605 is offline
 
Join Date: Feb 2004
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tamarian
vBouncer must delete the emails after processing, otherwise it will count them as duplicates on the next run. If you get too many bounced emails on every run, just increase the frequency of the collection task, as explained in the first post. If you really need to save copies of your bounced emails, just create a cron job to copy the file for you.
Thanks. That's what I am doing. I just created another account, which gets a copy of all the emails coming, so that when I see some patterns that my configuration cannot catch, I can just go back and modify the pattern according to it, then copy the emails from the backup account to re-process it.

Currently, I have a large amount of emails being processed but vbouncer claims no bouncing emails found. I checked the code, and find the following code kind of confusing:

PHP Code:
 if (preg_match('/^Final-Recipient:/m'$Body$matches)){ 
This is checked in function CombThrough($Header, $Body) and again in function Process_Std_Report($Header, $Body). I looked at my emails, none of them has this pattern in it, which explains why I get more than a thousand bounced email in a batch mass email, but vbouncer claims no bouncing emails found. So, I guess I will have to modify this code, right? However, in most of my bounced email, I do see this:

X-Failed-Recipients: adfasdfl@yhaoo.com

Is it safe for me to remove the above search for ^Final-Recipient?

Thanks.
Reply With Quote
  #79  
Old 07-08-2005, 11:52 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jb605
I looked at my emails, none of them has this pattern in it, which explains why I get more than a thousand bounced email in a batch mass email, but vbouncer claims no bouncing emails found. So, I guess I will have to modify this code, right?
No, you don't have to modify the code (but it's GPL, so you may, if you want to)

vbouncer.inc allows you to add the proper patterns that match your usual bounced emails without modifying the code.

vbouncer.inc currently holds 4 patterns that match the samples people here sent me so far, but you can add your own patterns to it as new cases.

Not sure if you are using an old version without vbouncer.inc (it was added recently), you might want to click install to get the latest updates.
Reply With Quote
  #80  
Old 07-09-2005, 12:54 AM
jb605 jb605 is offline
 
Join Date: Feb 2004
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My fault. I should add that pattern into vbouncer.inc instead of modifying the code. Adding it to vbouncer.inc does the same thing.

Thanks.

Also, maybe you didn't expect, but I have a few thousands of bounced email addresses, and my stats page takes a long time to load. A pagination will probably solve that problem.
Reply With Quote
  #81  
Old 07-14-2005, 05:25 PM
Fallback Fallback is offline
 
Join Date: May 2005
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have this installed but it will not display any bounced emails in the stats screen and the

"Last run with results" portion of the same screen shows "19:00, 31st Dec 1969" as the last run date even though I ran the cron script myself manually in the admincp to test it. Im using the IMAP mode. What could be set wrong?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:25 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05008 seconds
  • Memory Usage 2,338KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (5)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete