Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
Bounced email handler Details »»
Bounced email handler
Version: 1.1, by rebelde rebelde is offline
Developer Last Online: May 2015 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 4.2.x Rating:
Released: 03-30-2014 Last Update: Never Installs: 33
DB Changes Uses Plugins
Re-useable Code Additional Files Translations Is in Beta Stage  
No support by the author.

What does the bounced email handler do?
It stops sending emails to addresses that are no longer valid. This helps keep your email from being marked as spam, and helps get your legitimate emails through spam filters as a result.

More technically:
  1. It collects emails that "bounce" (are returned to you, the sender),
  2. Counts them and marks those accounts with lots of bounces.
  3. It stops sending "new post" notifications to those addresses.
To install:
  1. Set up a separate email address to handle bounces, such as bounce@yourdomain.com.
    (Do not use your normal email address. This modification will delete your other emails if you do!)
  2. Upload the PHP file.
  3. Install this plugin.
  4. AdminCP > Settings > Options > Email Options: Set "Bounce email address" to the address in step 1.
  5. AdminCP > Settings > Options > Bounced Email Handler: Fill in your settings
  6. Test it:
    - AdminCP > Scheduled Tasks > bounced_email_handler > Run Now to see if it is working.
    - Check the email account to make sure that it is deleting the emails that it has imported.
Areas of improvement:
  1. Find a way to stop sending other emails that shouldn't be sent such as forum subscription updates and birthday messages.
  2. Add switch to not send PMs.
  3. Add option to archive instead of delete emails for Gmail accounts.
Please fork this add-on for VB5 and other forum software. You have my permission!

Download Now

File Type: zip vB bounced email handler.zip (6.6 KB, 256 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
3 благодарности(ей) от:
puertoblack2003, RichieBoy67, SaN-DeeP

Comments
  #22  
Old 08-25-2014, 02:58 PM
rebelde rebelde is offline
 
Join Date: Jun 2008
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My experience is that Gmail and Yahoo just send your emails to the Spam folder and don't bother sending any sort of notification. Of course, different email providers can do different things, but this isn't a problem that I have run across.

If it did happen, fixing it is a simple as running the right UPDATE on the table.

UPDATE beh_users SET deliverflag = 0 WHERE email like '%@gmail.com';

Or something like that.
Reply With Quote
  #23  
Old 11-15-2014, 01:53 PM
dknelson dknelson is offline
 
Join Date: Oct 2004
Posts: 412
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I used this to send emails to all the "waiting email confirmations" user group. I don't know what I did but I ended up pruning a lot of them. There are now only 44 left in that user group. Half of those though when I click on them, it says "invalid user". I can't figure out how to remove those invalid users from the user group as when I click on "delete" for that user, I get the invalid user screen. How do I remove them for the primary user list in my AdminCP?
Reply With Quote
  #24  
Old 11-17-2014, 11:37 AM
rebelde rebelde is offline
 
Join Date: Jun 2008
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dknelson View Post
I used this to send emails to all the "waiting email confirmations" user group. I don't know what I did but I ended up pruning a lot of them. There are now only 44 left in that user group. Half of those though when I click on them, it says "invalid user". I can't figure out how to remove those invalid users from the user group as when I click on "delete" for that user, I get the invalid user screen. How do I remove them for the primary user list in my AdminCP?
This really is beyond the scope of what this modification is trying to do. I would suggest that you try the tools in AdminCP > Maintenance > General Update Tools. One of them might fix it.
Reply With Quote
  #25  
Old 03-08-2015, 03:39 PM
thunderclap82 thunderclap82 is offline
 
Join Date: Nov 2008
Posts: 305
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is it possible to add a way to auto move a user to a usergroup if their email bounces back?
Reply With Quote
  #26  
Old 03-09-2015, 01:10 PM
rebelde rebelde is offline
 
Join Date: Jun 2008
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by thunderclap82 View Post
Is it possible to add a way to auto move a user to a usergroup if their email bounces back?
I can't help you, sorry, but you can edit the code if you want.
Reply With Quote
  #27  
Old 04-29-2015, 01:42 PM
phriek phriek is offline
 
Join Date: Mar 2010
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I installed this mod but i use mandrill as mailprovider. I enabled an option in mandrill, which sends the bounced mails to a specific address, which works great,
But: The mails, which will be collected by the Bounced-Script via imap are only deleted and not saved to the database.

the message text of my bounced mail looks like this:

Code:
Hello, this is the mail server on mail135.atl41.mandrillapp.com.

I am sending you this message to inform you on the delivery status of a
message you previously sent.  Immediately below you will find a list of
the affected recipients;  also attached is a Delivery Status Notification
(DSN) report in standard format, as well as the headers of the original
message.

  <user@address.com>  delivery failed; will not continue trying
in beh_maillist.php i found:

Code:
// Try an alternate match
			if (!preg_match('/^.*@.*$/m', $body, $matches) OR $from['mailbox'] != 'Mailer-Daemon')
This should collect the email from the mail body, right? but why it doesn't work with mine?

Thanks alot!

//EDIT

Got it to work for me. If you get the bounced mail forwarded as shown above, change the code in forum/includes/cron/beh_maillist to this:

around line 174
Code:
	// Try an alternate match
			if (!preg_match('/[a-z\d._%+-]+@[a-z\d.-]+\.[a-z]{2,4}\b/i', $body, $matches))
around line 186
Code:
// Valid bounced email, go!
				$from = trim($matches[0]);
Reply With Quote
  #28  
Old 04-30-2015, 02:29 PM
rebelde rebelde is offline
 
Join Date: Jun 2008
Posts: 34
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

IMPORTANT:
I improved the plugin to do a much better job, but haven't had time to publish it here. Now, I will no longer be using vBulletin, so I'm giving you all the current code, in the hopes that one of you will take over this plugin and create a new version based on it.

Quote:
Originally Posted by phriek View Post
The mails, which will be collected by the Bounced-Script via imap are only deleted and not saved to the database.
I suggest testing different things with the code to see what works. You might also want to test the code attached to this post.
Attached Files
File Type: zip bounced_email_handler.zip (3.5 KB, 37 views)
Reply With Quote
  #29  
Old 09-25-2015, 01:52 AM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The following may be useful to someone...
Code:
// TURN OFF ALL EMAIL OPTIONS 
$adminemail=$vbulletin->bf_misc_useroptions['adminemail'];
$showemail=$vbulletin->bf_misc_useroptions['showemail'];
$emailonpm=$vbulletin->bf_misc_useroptions['emailonpm'];
$receivefriendemailrequest=$vbulletin->bf_misc_useroptions['receivefriendemailrequest'];
$vbulletin->db->query_write("UPDATE `user` SET `options` = `options` - $adminemail WHERE `user`.`userid` = $userid AND `user`.`options` & $adminemail");
$vbulletin->db->query_write("UPDATE `user` SET `options` = `options` - $showemail WHERE `user`.`userid` = $userid AND `user`.`options` & $showemail");
$vbulletin->db->query_write("UPDATE `user` SET `options` = `options` - $emailonpm WHERE `user`.`userid` = $userid AND `user`.`options` & $emailonpm");
$vbulletin->db->query_write("UPDATE `user` SET `options` = `options` - $receivefriendemailrequest WHERE `user`.`userid` = $userid AND `user`.`options` & $receivefriendemailrequest");
//TURN OFF MAIL SUBSCRIPTIONS 
$vbulletin->db->query_write("UPDATE `subscribethread` SET `emailupdate` = '0' WHERE `subscribethread`.`userid` = $userid;");
$vbulletin->db->query_write("UPDATE `subscribegroup` SET `emailupdate` = '0' WHERE `subscribegroup`.`userid` = $userid;");
$vbulletin->db->query_write("UPDATE `subscribeforum` SET `emailupdate` = '0' WHERE `subscribeforum`.`userid` = $userid;");
$vbulletin->db->query_write("UPDATE `subscribediscussion` SET `emailupdate` = '0' WHERE `subscribediscussion`.`userid` = $userid;");
https://vborg.vbsupport.ru/showthread.php?t=297249
Reply With Quote
  #30  
Old 09-26-2015, 05:49 PM
ndahiya ndahiya is offline
 
Join Date: Aug 2004
Posts: 210
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alternatively (or in addition), the following code will change the usergroup to users awaiting email confirmation.

Code:
$vbulletin->db->query_write("UPDATE `user` SET `usergroupid` = 3 WHERE `userid` = $userid ");

ndahiya
Reply With Quote
  #31  
Old 09-29-2015, 02:37 PM
sevenmix's Avatar
sevenmix sevenmix is offline
 
Join Date: Apr 2009
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry but... where could i find the pm text?

The one that starts something like this:
"The notification emails that the forum sends you"

Greetings
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 09:23 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.08169 seconds
  • Memory Usage 2,338KB
  • Queries Executed 26 (?)
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
  • (6)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (3)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete