Go Back   vb.org Archive > vBulletin Modifications > Archive > Modification Graveyard
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Cron based e-mail sending Details »»
Cron based e-mail sending
Version: 3.8.001, by Paul M Paul M is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Category: Administrative and Maintenance Tools - Version: 3.8.x Rating:
Released: 01-09-2009 Last Update: Never Installs: 295
Uses Plugins
Code Changes Additional Files Translations  
No support by the author.

As of 24 Nov 2017 this modification has been withdrawn.

In default vBulletin, if you send a large number of e-mails, vbulletin either puts them in it's queue and attempts to send them as each user visits a page, or just simply tries to send them straight away (as is the case when you use the Administrators email users inteface).

The result of this can be that your server can gets seriously overloaded very quickly - or on many hosts, you get banned for exceeding their e-mail sending limits. This can make sending several thousand e-mails (like a newsletter) very difficult.

This modification does two things ;

1. The processing of the mail queue is set-up as a vbulletin cron item.

2. Allows you to add a small delay before each e-mail is sent (between 1 and 9 seconds).

3. E-mails from the ACP inteface are sent to the mail queue, not straight to the mail system.

Use option 2 carefully, otherwise you will slow your e-mail system right down.

For this to work, you must turn on e-mail queuing in the ACP options - set 'Use Mailqueue System' to 'Yes', and 'Number of Emails to Send Per Batch' to a realistic value (based on the cron setting, as below).

There are two options for the cron job, you can either set it to run every minute, and set the items to be processed to something small (like 10), or you can do what this modification does by default and set it to run every 10 minutes, and set the items to be processed to something larger (like 100).

Remember, 10 per minute = 600 per hour, 100 per 10 minutes is also 600 per hour. The numbers really depend on how quick you want large queues processed, and how much your mail server can handle in one go.

Once working, when using the ACP mail users inteface, remember you can set it to process 9999 at once (not 500 or whatever) as the mails will now go into the queue, not be sent directly.

Note: This modification will affect any queued e-mails such as subscription e-mails. It will not affect registration e-mails as they bypass queuing anyway.

This modification includes the code by Antivirus that displays the current size of the mail queue.


History:

v3.8.001 : First Release for vB 3.8.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
4 благодарности(ей) от:
ahmedeldeep, need2fart, rpgamersnet, xorex

Comments
  #102  
Old 10-24-2009, 01:49 PM
vwdforum vwdforum is offline
 
Join Date: Jun 2006
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M View Post
If you dont get an error message then there isnt much i can tell you - it sounds like your server is unable to send mail. Have you tried this in the diagnostics ?

JFYI, Im about to go on holiday, so I may not actually see your reply until the end of next week.
Hope you enjoy your holidays!

I'm pulling my hair out now, I am able to send emails via the diagnostic test email, also, the standard emails are being sent out (like password reminder, new member etc)

Any suggestions please, your help is appreciated
Reply With Quote
  #103  
Old 10-26-2009, 05:42 PM
alla n1015 alla n1015 is offline
 
Join Date: Jan 2008
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just wondering if there is any way to test this module?
I see that there is a 'test' selection on the send email to user, but no ideas if that tests this module?

Allan
Reply With Quote
  #104  
Old 10-27-2009, 12:50 PM
BOWZONE's Avatar
BOWZONE BOWZONE is offline
 
Join Date: Feb 2005
Location: Alberta, Canada
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great mod! Been using this since last year on 3.7...Upgraded to 3.8 and forgot to upgrade to the newest version...OOPS! Hope my ISP doesn't catch my email blast of many thousands of emails this morning.

**INSTALLED!!!**...and upgraded...
Reply With Quote
  #105  
Old 10-27-2009, 03:34 PM
ChopSuey ChopSuey is offline
 
Join Date: Jun 2009
Location: Alaska
Posts: 2,140
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So awesome this works fine =] Thanks
*installed /nominated
Reply With Quote
  #106  
Old 11-07-2009, 03:55 PM
alla n1015 alla n1015 is offline
 
Join Date: Jan 2008
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any Ideas on how to test this? If I select a thousand members, and hit send, I dont want to actually send mail to 1000 members, before making sure this works.
Reply With Quote
  #107  
Old 11-07-2009, 07:20 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 vwdforum View Post
Any suggestions please, your help is appreciated
Sorry, there is nothing else i can suggest, it would need server access to start tracing what your server is (or isnt) doing.
Reply With Quote
  #108  
Old 11-07-2009, 07:56 PM
len backus len backus is offline
 
Join Date: May 2007
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Paul,

I've been getting frequent database errors that reference "mailqueue":
Quote:
Database error in vBulletin 3.8.4:

Invalid SQL:

UPDATE datastore SET
data = data - 49,
data = IF(data < 0, 0, data)
WHERE title = 'mailqueue';

MySQL Error : MySQL server has gone away
Error Number : 2006
Request Date : Saturday, November 7th 2009 @ 07:40:22 AM
Error Date : Saturday, November 7th 2009 @ 07:40:57 AM
Script : http://www.longrangehunting.com/foru...and=1257597618
Referrer : http://www.longrangehunting.com/forums/
IP Address : 173.73.121.35
Username : Unregistered
Classname : vB_Database
MySQL Version :
Quote:
Database error in vBulletin 3.8.4:

Invalid SQL:

UPDATE datastore SET
data = data - 5,
data = IF(data < 0, 0, data)
WHERE title = 'mailqueue';

MySQL Error : MySQL server has gone away
Error Number : 2006
Request Date : Saturday, November 7th 2009 @ 09:00:24 AM
Error Date : Saturday, November 7th 2009 @ 09:00:45 AM
Script : http://www.longrangehunting.com/foru...hp?rand=147496
Referrer : http://www.longrangehunting.com/arti...enance-2-3.php
IP Address : 98.125.108.202
Username : Unregistered
Classname : vB_Database
MySQL Version :
These are just 2 that came in this morning. There have been at least 2 each day. I submitted a support ticket to my server techs (ServInt VPS) and it was suggested that it isn't a MySQL server error:
Quote:
This seems to be an SQL error as opposed to a MySQL server error. Check the script or the SQL query you're running. Also, try to run a similar query manually to verify if this is a SQL error.
I may be able to run a query with more guidance. I thought I'd check with you first and if there is a specific query I should run, you could guide me.

Thanks.
Reply With Quote
  #109  
Old 11-07-2009, 08:26 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

Its very much a MySQL error - MySQL server has gone away is a bit of a give away

It means that the mysql connection has closed, almost certainly because its timed out - suggesting that MYSQL on your server has a very low timeout setting (Wait Timeout).
Reply With Quote
  #110  
Old 11-07-2009, 08:53 PM
len backus len backus is offline
 
Join Date: May 2007
Posts: 91
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's what I thought and discussed that with them several days ago. Different tech. I'll ask for the other techie and see if it can be resolved. Thanks for your response.
Reply With Quote
  #111  
Old 11-07-2009, 10:38 PM
alla n1015 alla n1015 is offline
 
Join Date: Jan 2008
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For testing I have modified email.php to put the To address to a dedicated account
and modified the message body to add the address it would have gone to.
This way I can run some samples and validate everything, the timings etc.

Call me stupid but i cant figure out hwo to drop the cron timing from once every 10m to once every 1m ?

Help?

Update - Never mind, found it under Schedule Task Manager
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 04:58 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09671 seconds
  • Memory Usage 2,319KB
  • 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_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
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (4)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
  • (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_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete