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

Reply
 
Thread Tools
vBouncer : Unsubscribe threads for members with bouncing emails Details »»
vBouncer : Unsubscribe threads for members with bouncing emails
Version: 1.00, by tamarian tamarian is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.3.x Rating:
Released: 05-31-2003 Last Update: Never Installs: 9
 
No support by the author.

What vBouncer does
vBouncer will reduce your server load, bandwidth, and your forum admin in-box, by unsubscribing members who keep bouncing their emails back to your forum admin email, which may bomb your mail box if you have a busy forum with many members who subscribe to many threads, but their emails are either invalid, in box full, or have ISP problems.

Screen shots
None, this is a command line script, with some changes in functions.php

Who may want to use this?
1. Very busy sites, with thousands of notifications a day.
2. Your admin box gets too many bouncing emails
3. You use sendmail. I'm not sure how this works on other mail servers.

Caution
This may drive some of your members mad If their email bounces a lot, this script will unsubscribe them from their favourite threads. They will have to fix their email account, and then subscribe manually to each thread again... This may not be due to bad emails, just ISP side problems.

Use at your own risk. I'm sharing this since some indicated interest at vBulletin.com in this thread:
http://www.vbulletin.com/forum/showt...threadid=71496
I'd be glad to help answer questions, but as with most hacks, it is your responsibility....


Installation
1. Create a unique email address on your server, dedicated to catch bouncing emails. Do not use adminemail, or any other existing email that you want to receive through a POP account. This email will be used only to catch bouncing emails.

Recommended name (makes for less editing): subscriber_notify

2. Edit functions.php

Find:
PHP Code:
        // work out the 'From' header
        
if ($from == '') {
            
$headers "From: \"$bbtitle Mailer\" <$webmasteremail>\r\n" $headers;
        } else {
            
$headers 'From: "' iif($username"$username @ $bbtitle"$from) . "\" <$from>\r\n" $headers;
        }

        
// actually send the email message
        
mail($toemail$subject$messagetrim($headers)); 
Replace with:
PHP Code:
                // work out the 'From' header
                
if ($from == '') {
                        
$from $webmasteremail;

                        
$headers "From: \"$bbtitle\" <$webmasteremail>\r\n" $headers;
                } else {
                        
$headers 'From: "' iif($username"$username @ $bbtitle"$from) . "\" <$from>\r\n" $headers;
                }

                
// actually send the email message
                
mail($toemail$subject$messagetrim($headers), "-f$from"); 
Find:
PHP Code:
vbmail($touser['email'], $emailsubject$emailmsg); 
Replace with: replace subscriber_notify@example.com with your domain name)
PHP Code:
    $emailerusername "New Reply Notification";
    
$emailer "subscriber_notify@example.com"// change this to your bouncer email account.
    
$emailerheader "Reply-To: $emailer\nErrors-To: $emailer\n";
    
vbmail($touser['email'], $emailsubject$emailmsg$emailer$emailerheader$emailerusername); 
3. Copy vBouncer.pl.txt to a directory on your server. vBouncer.pl.txt is attached below.

Rename it to vBouncer.pl by typing:

mv vBounver.pl.txt vBouncer.pl

Make it executable by typing:

chmod +x vBouncer.pl

4. Edit the configuation section of vBouncer.pl
Code:
#! /usr/bin/perl -w
#
# USAGE: vBouncer.pl -bounce : to unsubscribe threads from members with bouncing email
#        vBouncer.pl : with no parameters to see (test) who will be unsubscribed
#
# When done, remember to reset the email file,
#       cp /dev/null subscriber_notify (or whatever filename your bouncing email file is chosen)
#
# Copyright (c) 2003 Mad SCO Disease, released under GPL. Mad SCO Disease reserves the right
# to sue your butt, if you don't buy out their small time company. Check eBay for current bids.
#
# Details on Mad SCO Disease provided here: http://www.opensource.org/sco-vs-ibm.html
# For the proper way to eat sane cows, check here: http://www.lowcarb.ca

# Config:
my $bouncelimit = 25;  # how much bounced emails are allowed, before taking actions
my $unsubscribe = 1;    # unsubscribe member from all subscribed threads, 1=yes, 0=no
my $changedefault = 1;  # change subscription default to no. 1=yes, 0=no
my $nobulletin = 0;     # This is only for those who installed the newsletter bulletin hack
                        # change receive bulletin option to no. 1=yes, 0=no
my $changeusergroup = 0;# change user group to bounced group, 1=yes, 0=no
                        # THIS IS NOT RECOMMENDED USE WITH CAUTION
                        # IF AMINS AND/OR MODS BOUNCE EMAILS, IT WON'T CHECK
                        # IF you really want to use this option, you will need to uncomment the code
my $bouncedgroup = 2;   # the usergroup id for bouncing members, be careful, this number
                        # must match the user group id you setup in the vb control panel (not yet implemented)

my $bouncefile = "/var/spool/mail/subscriber_notify";
                        # the path/to/bouncing emails file. "subscriber_notify is the email name, you need
                        # to change it to the email name you chose for bouncing emails.

my $db="database";        # mysql database name
my $db_host="localhost";                # mysql host
my $db_username="username";             # mysql username
my $db_password="password";             # mysql password
5. Once a week or so, you can run the scropt manually, or through a cron job. When done, you have to clear the email file, otherwise it will keep unsubscribing members whos emails no longer bounce.

To run the script in test mode, type:

./vBounver.pl

To run the script in bouncer mode, type:

./vBounver.pl -bouncer

To clear the mail box, use:
cat /dev/null > subscriber_notify

6. Optional bonus: If you have very long threads, you can queue emails until the server load is acceptable. Edit /etc/sendmail.cf

Find:
# load average at which we just queue messages
#O QueueLA=5

Change to:
# load average at which we just queue messages
O QueueLA=3

This basically means sendmail will not attempt to deliver the email if your server is at load average of 3 or greater, it will place it in the mail queue for later delivery. You can change this number to suit your needs.

Planned enhancments (will wait for vB 3.0)

1. Instead of unsubscribing members threads, suspend notification by making a copy of their subscriptions, and copying them back when emails no longer bounce.

2. Track bounce history through admin panel,. This is similar to the old eGroup bouncing history.

3. Automatically PM members re their bounced emails.

4. Offer an option to admin to disable email notification to bouncing members, but keep the subscription. Similar to vB 3.0's daily and weekly notification, but adding a "no emails" option. This is also planned to be a seperate hack. If someone already has access to vB3.0, feel free to use this idea


Attached file is dated June 1st, 2003

Show Your Support

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

Comments
  #2  
Old 06-01-2003, 08:38 PM
cirisme cirisme is offline
 
Join Date: Jan 2003
Posts: 136
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice.

Will have to give it a try.
Reply With Quote
  #3  
Old 06-01-2003, 08:41 PM
colicab-d's Avatar
colicab-d colicab-d is offline
 
Join Date: Dec 2002
Location: Glasgow
Posts: 382
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

just so u know.. its agood idea to attach hacks in a txt or zip file so unlicensed users cant get a hold of them.. just thought id beat the mods too it lol soz
Reply With Quote
  #4  
Old 06-01-2003, 09:11 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 10:41 PM colicab-d said this in Post #3
just so u know.. its agood idea to attach hacks in a txt or zip file so unlicensed users cant get a hold of them.. just thought id beat the mods too it lol soz

It is attached as a text file.....
Reply With Quote
  #5  
Old 06-01-2003, 09:14 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What I like most about this script, is the copyright notice! I'm surprised no one remarked on it....
Reply With Quote
  #6  
Old 06-02-2003, 04:18 AM
Erwin's Avatar
Erwin Erwin is offline
 
Join Date: Jan 2002
Posts: 7,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How very cool! I love this idea... shall look into this further when I get home...
Reply With Quote
  #7  
Old 06-02-2003, 03:39 PM
Overgrow's Avatar
Overgrow Overgrow is offline
 
Join Date: Nov 2001
Posts: 320
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

EXCELLENT! Thanks so much for the hack. I'm using a modified 2.2.9 and since the mail routines were changed going to 2.3.0, it did not install as described. I couldn't get the mail to bounce back to a new handle, so I'm just pulling it from the normal bounce pile.

Thanks again.. licks install... this ought to save me a few thousand emails a week.
Reply With Quote
  #8  
Old 06-02-2003, 08:06 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 05:39 PM Overgrow said this in Post #7
I'm using a modified 2.2.9 and since the mail routines were changed going to 2.3.0, it did not install as described.
Here's how to do it for 2.2.9, only one line to change. I have not tested this, since both my server and test server both run 2.3, but it should work. From reading about the PHP mail parameter, it doesn't work sometimes with safe mode is on....

In functions.php, find:
PHP Code:
mail($touser[email],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>"); 
Replace with:
PHP Code:
$bouncemail "subscriber_notify@example.com"// change this to the new email account dedicated to bounced notification emails. 
mail($touser[email],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>"," -f$bouncemail"); 
If anyone trys this one and it works , please let me know. I'll add it to the instructions.

Edit: Modified for an enhancement mentioned 3 posts below.
Reply With Quote
  #9  
Old 06-03-2003, 07:59 PM
pgowder's Avatar
pgowder pgowder is offline
 
Join Date: Nov 2001
Location: West Columbia, SC
Posts: 537
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Yesterday at 05:06 PM tamarian said this in Post #8
Here's how to do it for 2.2.9, only one line to change. I have not tested this, since both my server and test server both run 2.3, but it should work. From reading about the PHP mail parameter, it doesn't work sometimes with safe mode is on....

In functions.php, find:
PHP Code:
mail($touser[email],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>"); 
Replace with:
PHP Code:
$bouncemail "subscriber_notify@example.com"// change this to the new email account dedicated to bounced notification emails. 
mail($touser[email],$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$bouncemail>"," -f$bouncemail"); 
If anyone trys this one and it works , please let me know. I'll add it to the instructions.
I'm trying that now, but before I could finish installing, I've noticed that all the emails are now coming to my Outlook???
Reply With Quote
  #10  
Old 06-03-2003, 08:06 PM
pgowder's Avatar
pgowder pgowder is offline
 
Join Date: Nov 2001
Location: West Columbia, SC
Posts: 537
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looks like that made it send all emails to that address and not just those that bounce.
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 12:09 AM.


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.07097 seconds
  • Memory Usage 2,341KB
  • 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
  • (8)bbcode_php
  • (3)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
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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