Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
vBouncer: reduce server load by unsubscribing bouncing members from threads Details »»
vBouncer: 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.5.1 Rating:
Released: 06-20-2005 Last Update: 10-04-2005 Installs: 118
Uses Plugins
Additional Files  
No support by the author.

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.

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:
o Manual or auto processing option
o Collect logs via IMAP/POP or mail spool file
o Custom filters to match patterns in bounced emails
o Uses vB's cron files (Scheduled tasks)
o Uses encrypted header for authentication (suggested by Paul M).
o Stats on members with bouncing emails, and error codes
o Tuning options
o Verbose cron logs for diagnostics
o Option to send PM warning prior to reaching the limit
o Option to send PM notifications after reaching the limit
o Option to change the member's subscription default
o Option to all thread subscriptions to "no email"
o Option to all forum subscriptions to "no email"
o Option to move offenders to a different primary usergroup
o 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 => includes)
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. Import and activate the plugin file through the plugin manager.
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)
6. If you are using vB's SMTP email option, make sure to also enable the "-f" option.

Change log:

- August 12, 2005 v1.3 Update to the cron files to match new changes in vB's cron/tasks. To upgrade, just re-upload the contents of includes/cron.

- 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 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.5 Added custom header setting option, for re-written headers.

- June 26, 2005 v0.4 Found a way to make it work as a plugin, without code edits (thanks to Paul M)

- June 26, 2005 v0.3 No changes, just removed the plugin

- June 25, 2005 v0.2 Added NDR/Reply code errors to stats, and option to act upon 5.0.0/550 (user unknown)

- June 21, 2005: v 0.1 Initial release. Marked beta, but it's working fine on PostFix and SendMail. Need to hear from those who tried on QMail and Exim

Show Your Support

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

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

Quote:
Originally Posted by Paul M
I have no idea what a sym link is.
ln -fs /home/example/mail/example.com/subscription_bounces/inbox /path/to/admincp/subscriber_notify

Now you should be able to use /path/to/admincp/subscriber_notify as the file location (also make it chmod 666

Quote:
PHP Mail, I have not downloaded it since the beginning of the week. However, I got round the problem with a couple of extra lines in the plugin. No file edit needed.
It's not in the zip file. There are file edits in class_mail.php ( vBouncer is no longer a plugin) due to code needed for the header re-writes.
Reply With Quote
  #33  
Old 06-26-2005, 08:37 PM
ImportPassion ImportPassion is offline
 
Join Date: Mar 2002
Location: Gilbert, AZ
Posts: 605
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sym link no work either.

also, I added a clearstatscache() before the diagnostics happen

Quote:
You should also note that PHP doesn't cache information about non-existent files. So, if you call file_exists() on a file that doesn't exist, it will return FALSE until you create the file. If you create the file, it will return TRUE even if you then delete the file.
can you post the cron job you have that copies the file etc?
Reply With Quote
  #34  
Old 06-26-2005, 08:51 PM
buro9 buro9 is offline
 
Join Date: Feb 2002
Location: London, UK
Posts: 585
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M
2. The problem I haven't got round yet is that something (probably exim) appears to be rewriting the Return-Path to "nobody@<server-domain>" before sending the mails. I'm not sure how to stop this yet, but there must be a way because our live server doesn't do it.
Use the -f flag within PHP mail function to declare the sender address.
Reply With Quote
  #35  
Old 06-26-2005, 08:52 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by 7thgenCivic.Com
sym link no work either.
What didn't work? The diagnostic, or the log collection cron task? Was the link and the target both 666?
Reply With Quote
  #36  
Old 06-26-2005, 08:54 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by buro9
Use the -f flag within PHP mail function to declare the sender address.
The "-f " is added by the code edit, so it's on regardless of the vB settings
Reply With Quote
  #37  
Old 06-26-2005, 09:01 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tamarian
Now you should be able to use /path/to/admincp/subscriber_notify as the file location (also make it chmod 666)
Nope - the shortcut is created correctly, but it doesn't bypass the security, php still cannot read it.

Quote:
Originally Posted by tamarian
It's not in the zip file. There are file edits in class_mail.php ( vBouncer is no longer a plugin) due to code needed for the header re-writes.
So I see, but as I said - I got round it by changing the plugin to this ;

PHP Code:
if (empty($from) AND is_valid_email($vbulletin->options['vbouncer_spool_account']))
{
    
$this->registry->options['needfromemail'] = 1;
    
$fromemail $vbulletin->options['vbouncer_spool_account'];
    
$headers preg_replace('/Return-Path.*/''Return-Path: ' $vbulletin->options['vbouncer_spool_account'], $headers1);

The pregreplace is not actually required by myself, but I left it in.

Quote:
Originally Posted by 7thgenCivic.Com
can you post the cron job you have that copies the file etc?
Sure;

Code:
rm /home/<cpname>/public_html/zmail/inbox
mv /home/<cpname>/mail/<emaildomain>/<emailname>/inbox  /home/<cpname>/public_html/zmail
zmail is a folder I created just for this system. I put the above in a file which is run via cron once a day.

Reply With Quote
  #38  
Old 06-26-2005, 09:10 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My next problem is that it's failed to detect the bounced e-mail message.
Reply With Quote
  #39  
Old 06-26-2005, 09:14 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M
My next problem is that it's failed to detect the bounced e-mail message.
Was there any bounced emails in the file? Check the scheduled tasks log to see the output summary. Once you have bounced emails in the box, save me a copy and send it, so I can check the headers.

As to why the symlink doesn't work, I'm not sure, as I don't use cpanel. Check the apache error log, there might be some clues.
Reply With Quote
  #40  
Old 06-26-2005, 09:27 PM
tamarian tamarian is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Paul, buro9 and 7thgen:

Are you guys on similar setups? CPanel+Exim?

If so, there might be an alternative solution. Exim allows forwarding through .forward file and can use pipe the emails to the shell. So if the symlink for some reason doesn't work, you might be able to capture the emails to an alternative file within your public_html space.
Reply With Quote
  #41  
Old 06-26-2005, 09:37 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tamarian
If so, there might be an alternative solution. Exim allows forwarding through .forward file and can use pipe the emails to the shell. So if the symlink for some reason doesn't work, you might be able to capture the emails to an alternative file within your public_html space.
Well that's basically what I'm doing anyway by moving the spool once per day. I'm quite happy to process the rejects daily. That bit works now.

To answer your other question - yes, the file had exactly one rejected e-mail in it that i did as a test.

The reject headers are ;

Code:
From MAILER-DAEMON Sun Jun 26 22:13:31 2005
Return-path: <>
Envelope-to: mailrejects@mydomain.com
Delivery-date: Sun, 26 Jun 2005 22:13:31 +0100
Received: from mailnull by xxxxxxxx.miniserver.com with local (Exim 4.43)
	id 1DmeRW-0002OX-Eq
	for mailrejects@mydomain.com; Sun, 26 Jun 2005 22:13:30 +0100
X-Failed-Recipients: this-should-be-rejected@failed.com
Auto-Submitted: auto-generated
From: Mail Delivery System <Mailer-Daemon@xxxxxxxx.miniserver.com>
To: mailrejects@mydomain.com
Subject: Mail delivery failed: returning message to sender
Message-Id: <E1DmeRW-0002OX-Eq@xxxxxxxx.miniserver.com>
Date: Sun, 26 Jun 2005 22:13:30 +0100

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  this-should-be-rejected@failed.com
    SMTP error from remote mailer after RCPT TO:<this-should-be-rejected@failed.com>:
    host smtpin.failed.com [81.xx.xx.xx]: 550 Invalid recipient:
    <this-should-be-rejected@failed.com>

------ This is a copy of the message, including all the headers. ------
(Some addresses changed obviously)
Reply With Quote
Reply


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 02:30 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.05017 seconds
  • Memory Usage 2,330KB
  • 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
  • (2)bbcode_code
  • (1)bbcode_php
  • (11)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
  • (1)pagenav_pagelinkrel
  • (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