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

Reply
 
Thread Tools
Auto Bounce Messages Management Details »»
Auto Bounce Messages Management
Version: 1.0.0.b.1, by Milad Milad is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.7.0 Rating:
Released: 06-07-2008 Last Update: 06-07-2008 Installs: 86
DB Changes Uses Plugins
Additional Files Is in Beta Stage  
No support by the author.

Brought to you by Syrian Medical Society & Milado

Introduction: quoted from wikipedia with adaptation.
Any long-lived forums is going to eventually contain addresses that can't be reached. Addresses that were once valid can become unusable because the person receiving the mail there has switched to a different provider (possibly as a result of changing jobs or schools). In another scenario, the address may still exist but be abandoned, with unread mail accumulating until there is not enough room left to accept any more.

The presence of invalid addresses in the forums results in bounce messages being sent to the owner of the forums. If the mailing list is small, the owner can read the bounce messages and manually remove the invalid addresses from the forums. With a larger forums, this is a tedious, unpleasant job, so it is desirable to automate the process.

In short: This hack automates handling of the bounce messages.


Requirements:
  • vBulletin 3.7.1
  • catch-all email address, with POP3 access. (I use Google app (Gmail))

Features:
  • Auto Bounce Messages Management.
  • Uses POP3 protocol to retrieve messages from your catch-all email box.
  • On bounce detection the user will be moved to bounce usergroup (you can set which usergroup).
  • Works according to VERP.
A note:
I believe there is no need to delete the user subscriptions. because once a user got moved to the "Awaiting email confirmation" usergroup, he / she won't be sent any additional emails.

How Does It Work?
You have your catch-all email box, that will be used to receive the bounce messages. Of course we must have a POP3 access to retrieve messages from it.
Let's suppose that your catch-all email address is bounces@yourdomain.ext
After we set it properly, it will work as described below:
1) By default: On every single message being sent, vBulletin generates a unique Message-ID for it, example:
Code:
Message-ID: <20080608103128.551e45224330@www.yourdomain.ext>
This ID is generated By using the following code in /includes/class_mail.php:
PHP Code:
$msgid '<' gmdate('YmdHis') . '.' substr(md5($message microtime()), 06) . vbrand(100000999999) . '@' $http_host '>'
I take the red portion from the unique Message-ID, and the red portion from the domain name of the catch-all address:
Code:
Message-ID: <20080608103128.551e45224330@www.yourdomain.ext>
Code:
bounces@yourdomain.ext
The result will be:
Code:
bounce20080608103128.551e45224330@yourdomain.ext
Now every single message has its own unique envelope-from address. so if it gets returned as a bounce, I will recognize it easily.
So every message will be recorded in the database. each record consists of : toemail, bounceemail (the one we generated) and the timeline (for sake of pruning.)
2) A cron job runs every ten minutes to retrieve bounce messages from the catch-all email box.
If the message sent to something similar to the bounceemail we generate, it will update the appropriate record in the database to be marked as returned. and delete the message from the POP3 server.
3) Another cron job runs once an hour, reads the bounced emails from the database and moves their owners to an usergroup which is determined by the admin from the settings.
4) Yet another cron job, will run once daily, to prune the records that haven't returned bounces in a settable period of time (30 days by default).

Did I miss something here?
Yeh, right. this is the first beta, I believe the core is almost done. but there may be some functions to add, and few things to tweak.
I'm all opened to your suggestions. So feel free to dream!

Installation & Upgrade:
1) Have your own catch-all email with POP3 access. I don't have the time to write a how-to article for this please do it yourself, you'll be luckily if someone explains it to others.
2) Upload files from the /upload/ folder in the package to their appropriate locations.
3) Install the xml product file: product-bounce_management.xml, of course choose yes to override when upgrading.
4) Refresh your AdminCP. you will see at the navigation side, above the Users tab, a new tab called "Bounces Management"
5) At that tab, go to the settings: Set your POP server settings, your "Bounce Usergroup" and "Exclude Usergroups".
6) At the same tab you will find a link called "Test POP Connection" to test the connection with your POP server.
7) Enjoy! Click install to let me enjoy too!

Settings:
Attachment 81933

Know issues:
- In rare situations, a vacation reply may returned via the bounce path rather than the webmaster path.


Change log:
  • 1.0.0.b.1 first public release, on June, 8 2008.
Support:
The product marked as not supported, but that doesn't mean you won't see me again here.
So please try to help each other.

License & Credits:
1) I use the pop3_class from Manuel Lemos, Copyright (c) 1999-2005 to retrieve messages from the POP server, so all the credits regarding this go to him.
Here is his license (included in the package too):
Quote:
Copyright (c) 1999-2005, Manuel Lemos
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Manuel Lemos nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Click install to receive updates.
You like it? nominate it. I'm looking forward to enter the Mod Of The Month competition.
I depend on you.
Also donations will help me to improve the product. :up:

Show Your Support

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

Comments
  #132  
Old 04-10-2009, 03:59 AM
AngelBlue AngelBlue is offline
 
Join Date: Jun 2007
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by AngelBlue View Post
I've added some code so that bouncing users now get:
* Popup PM notification set to YES
* Receive admin emails set to NO
* Recieve email PM notification set to NO
* Thread subscription mode set to "no email" (if it was previously set to instant, daily or weekly email)
* All their thread and forum subscriptions set to 'no email'.
* A PM to explain the above.

To do this, I replaced the code in your "Move Users To Bounce Usergroup" plugin with this:

Code:
$bounces = $vbulletin->db->query_read("
	SELECT messageid, toemail
	FROM " . TABLE_PREFIX . "sent_email
	WHERE bounced = 1
");

if ($vbulletin->db->num_rows($bounces) > 0)
{
	$toemails = array();
	$messageids = array();
	
	while ($bounce = $vbulletin->db->fetch_array($bounces))
	{
		$toemails[] = "'" . $bounce['toemail'] . "'";
		$messageids[] = $bounce['messageid'];
	}
	$toemails = array_unique($toemails);

	// start added code here... define data for PM data manager

	$tonames = array();
	$touids = array();
	$myuid = 1;
	$fromuser = fetch_userinfo($myuid);
	$message = "We tried to deliver an email to you, but unfortunately, it bounced. To prevent us sending more mail to you while your email provider is not accepting it, we have deactivated all the email-related features of your account. To reactivate your account, go to your UserCP, and update your email address. You will then get a confirmation email. Clicking on the link in this confirmation email should re-enable your account, at which point you will need to visit your UserCP options page to re-enable the email notifications you wish to use.";

	$affected = $vbulletin->db->query_read("SELECT userid,username FROM " . TABLE_PREFIX . "user WHERE email IN (" . implode(', ', $toemails) . ")");
	while ($affected = $vbulletin->db->fetch_array($affected)) {
		$tonames[] = $affected['username'];
		$touids[] = $affected['userid'];
	}
	$tonames = array_unique($tonames);
	$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_SILENT);
	$pmdm->set('fromuserid', '1');
	$pmdm->set('fromusername', 'EmailBot');
	$pmdm->set_info('reciept', false);
	$pmdm->set_info('savecopy', false);
	$pmdm->set('title', 'Email Broken!');
	$pmdm->set('message', $message);
	$pmdm->set_recipients(implode(";",$tonames), $fromuser['permissions']);
	$pmdm->set('dateline', TIMENOW);
	$pmdm->save();

	
	
	// this is stock mod code to move them to the different usergroup.
	$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET usergroupid = " .  $vbulletin->options['bm_usergroup'] . ", membergroupids = '', displaygroupid = 0 WHERE usergroupid NOT IN (" . $vbulletin->options['bm_excludeusergroups'] . ") AND email IN (" . implode(', ', $toemails) . ")");

	// and stock code to delete their message tracking info...
	$vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "sent_email WHERE messageid IN (" . implode(', ', $messageids) . ")");

	// continue custom code to update their user options...
	// stop them generating any more email!

	// pm popup = YES
	$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET pmpopup = 1 WHERE email IN (" . implode(', ', $toemails) . ")");
	
	// send notification email on PM - NO
	$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET options = (options - 4096) WHERE (options & 4096) AND email IN (" . implode(', ', $toemails) . ")");

	// admin email OFF
	$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET options = (options - 16) WHERE (options & 16) AND email IN (" . implode(', ', $toemails) . ")");

	// set autosubscribe = without email WHERE autosubscribe_with_email
	$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "user SET autosubscribe = 1 WHERE (autosubscribe > 1) AND email IN (" . implode(', ', $toemails) . ")");

	// set emailupdates = 0 for their thread subscriptions
	$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "subscribethread SET emailupdate = 0 WHERE (emailupdate > 0) AND userid IN (" . implode(', ', $touids) . ")");

	// set emailupdates = 0 for their forum subscriptions
	$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "subscribeforum SET emailupdate = 0 WHERE (emailupdate > 0) AND userid IN (" . implode(', ', $touids) . ")");

	// finish
	unset($toemails, $messageids);
}

$vbulletin->db->free_result($bounces);
Changed the lines listed in bold to avoid a 'only variables may be passed by reference' error when the hourly2 cleanup job runs. If you are using my patch, above, you should update. This error can prevent the running of that job, without alerting you.
Reply With Quote
  #133  
Old 04-10-2009, 04:58 AM
Smitty's Avatar
Smitty Smitty is offline
 
Join Date: Sep 2002
Location: Southern Ohio
Posts: 385
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Alfa1 View Post
If you update this hack, so that it works and does the following, then I will donate $100.
I'd throw in US$50. I deal with bounces daily and hate it.
Reply With Quote
  #134  
Old 04-10-2009, 05:36 AM
Milad's Avatar
Milad Milad is offline
 
Join Date: Apr 2005
Location: Syro
Posts: 663
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Will continue beta 2 as soon as I have time.
Reply With Quote
  #135  
Old 05-16-2009, 03:03 AM
wfouly's Avatar
wfouly wfouly is offline
 
Join Date: Jan 2008
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Uninstalled
it stop the all mail function of the forum
so members waiting email activation not activated
Reply With Quote
  #136  
Old 06-03-2009, 01:32 PM
Adam_EOGamer Adam_EOGamer is offline
 
Join Date: Feb 2009
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just a warning before anyone else adds this
It automatically placed a link in the footer of your forum, which when clicked, goes to the Syrian medical society (or something), the webpage has a trojan virus on it.
Reply With Quote
  #137  
Old 06-03-2009, 06:28 PM
Milad's Avatar
Milad Milad is offline
 
Join Date: Apr 2005
Location: Syro
Posts: 663
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

1- Everyone knows that this hack adds credits in the footer, and is free to remove them.
2- How can you make such an accusation? My website (Syrian Medical Society) is reputable website, and have never been as a distribution for malwares.
Here are what google says about it:
safe browsing
unmask parasites says: This page seems to be <suspicious> because of the following line:

HTML Code:
document.write('<marquee onmouseover="this.stop()" onmouseout="this.start()" direction="right" scrollamount="3" scrolldelay="20" class="smallfont">آخر ما نُشر لدينا&nbsp;&nbsp;&nbsp;??&nbsp;&nbsp;&nbsp;<a href="http://www.syrianmeds.net/forum/topic12165-newpost.html" target="_blank" class="smallfont">الفيزيولوجيا المرضية</a>&nbsp;&nbsp;&nbsp;??&nbsp;&nbsp;&nbsp;<a href="http://www.syrianmeds.net/forum/topic12162-newpost.html" target="_blank" class="smallfont">جراحة 3</a>&nbsp;&nbsp;&nbsp;??&nbsp;&nbsp;&nbsp;<a href="http://www.syrianmeds.net/forum/topic12160-newpost.html" target="_blank" class="smallfont">دوري علامات الطب سنة تانية</a>&nbsp;&nbsp;&nbsp;??&nbsp;&nbsp;&nbsp;<a href="http://www.syrianmeds.net/forum/topic12159-newpost.html" target="_blank" class="smallfont">داخلية 4</a>&nbsp;&nbsp;&nbsp;??&nbsp;&nbsp;&nbsp;<a href="http://www.syrianmeds.net/forum/topic12158-newpost.html" target="_blank" class="smallfont">داخلية 2</a>&nbsp;&nbsp;&nbsp;??&nbsp;&nbsp;&nbsp;<a href="http://www.syrianmeds.net/forum/topic12157-newpost.html" target="_blank" class="smallfont">التشريح المرضي العام</a>&nbsp;&nbsp;&nbsp;??&nbsp;&nbsp;&nbsp;<a href="http://www.syrianmeds.net/forum/topic12156-newpost.html" target="_blank" class="smallfont">أدوية 1</a>&nbsp;&nbsp;&nbsp;??&nbsp;&nbsp;&nbsp;<a href="http://www.syrianmeds.net/forum/topic12155-newpost.html" target="_blank" class="smallfont">تشريح 2</a>&nbsp;&nbsp;&nbsp;??&nbsp;&nbsp;&nbsp;<a href="http://www.syrianmeds.net/forum/topic12149-newpost.html" target="_blank" class="smallfont">الصحة تطلب من الصيادلة سحب عدد من المستحضرات الدوائية لمخالفتها للمواصفات</a>&nbsp;&nbsp;&nbsp;??&nbsp;&nbsp;&nbsp;<a href="http://www.syrianmeds.net/forum/topic12147-newpost.html" target="_blank" class="smallfont">ألم شديد في القدم</a></marquee>');
Which prints the marquee section, without causing the page to fail in the XHTML validation.

So please, before you make such an accusation, have the evidence that supports your claim.
Reply With Quote
  #138  
Old 06-04-2009, 07:46 AM
Alfa1's Avatar
Alfa1 Alfa1 is offline
 
Join Date: Dec 2005
Location: Netherlands
Posts: 3,537
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Adam_EOGamer View Post
Just a warning before anyone else adds this
It automatically placed a link in the footer of your forum, which when clicked, goes to the Syrian medical society (or something), the webpage has a trojan virus on it.
The only mallware that there is, is your virus scanner. For some reason several virus scanners/ link scanners report a lot of sites, that have no problem whatsoever, as containing mallware, virus or troyan horses. This happened to a site of mine that was coded in prolog in 1998 and therefore contained exotic code antivira could not understand and therefor antivira classified it as a troyan horse. I assure you that it was not. There are a mass of examples to be found on the net. Antivirus programs are simply not fit to scan websites for 'suspect' scripts.
Reply With Quote
  #139  
Old 06-05-2009, 09:14 PM
Milad's Avatar
Milad Milad is offline
 
Join Date: Apr 2005
Location: Syro
Posts: 663
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Statistics!
Reply With Quote
  #140  
Old 06-12-2009, 03:53 PM
testebr testebr is offline
 
Join Date: Jan 2004
Posts: 353
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Stats? That cool, this feature will be released in next update?

Any ETA, Milad?

Thanks!
Reply With Quote
  #141  
Old 06-29-2009, 08:55 AM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Milad View Post
Statistics!
nice! any more word on this feature or any other updates on this mod? It is truly a fantastic modification which I hope to see continued!
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 05:55 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.07532 seconds
  • Memory Usage 2,355KB
  • 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
  • (5)bbcode_code
  • (1)bbcode_html
  • (1)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
  • (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