From: skodak Date: Sat, 2 Feb 2008 16:22:47 +0000 (+0000) Subject: MDL-13239 improved smtp bulk setting based on feedback from Gary; merged from MOODLE_... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3a6c690a86687d8745eb4a3db5196b186bcdd225;p=moodle.git MDL-13239 improved smtp bulk setting based on feedback from Gary; merged from MOODLE_19_STABLE --- diff --git a/admin/settings/server.php b/admin/settings/server.php index 6fc9d2a53d..ad811870c5 100644 --- a/admin/settings/server.php +++ b/admin/settings/server.php @@ -23,7 +23,7 @@ $temp = new admin_settingpage('mail', get_string('mail','admin')); $temp->add(new admin_setting_configtext('smtphosts', get_string('smtphosts', 'admin'), get_string('configsmtphosts', 'admin'), '', PARAM_HOST)); $temp->add(new admin_setting_configtext('smtpuser', get_string('smtpuser', 'admin'), get_string('configsmtpuser', 'admin'), '', PARAM_NOTAGS)); $temp->add(new admin_setting_configpasswordunmask('smtppass', get_string('smtppass', 'admin'), get_string('configsmtpuser', 'admin'), '')); -$temp->add(new admin_setting_configtext('smtpmaxbulk', get_string('smtpmaxbulk', 'admin'), get_string('configsmtpmaxbulk', 'admin'), 0, PARAM_INT)); +$temp->add(new admin_setting_configtext('smtpmaxbulk', get_string('smtpmaxbulk', 'admin'), get_string('configsmtpmaxbulk', 'admin'), 1, PARAM_INT)); $temp->add(new admin_setting_configtext('noreplyaddress', get_string('noreplyaddress', 'admin'), get_string('confignoreplyaddress', 'admin'), 'noreply@' . $_SERVER['HTTP_HOST'], PARAM_NOTAGS)); $temp->add(new admin_setting_configselect('digestmailtime', get_string('digestmailtime', 'admin'), get_string('configdigestmailtime', 'admin'), 17, array('00' => '00', '01' => '01', diff --git a/lang/en_utf8/admin.php b/lang/en_utf8/admin.php index 195ad0140b..2b36ab512a 100644 --- a/lang/en_utf8/admin.php +++ b/lang/en_utf8/admin.php @@ -213,7 +213,7 @@ $string['configsitemailcharset'] = 'All the emails generated by your site will b $string['configsitepolicy'] = 'If you have a site policy that all users must see and agree to before using this site, then specify the URL to it here, otherwise leave this field blank. The URL can point to anywhere - one convenient place would be a file in the site files. eg http://yoursite/file.php/1/policy.html'; $string['configslasharguments'] = 'Files (images, uploads etc) are provided via a script using \'slash arguments\'. This method allows files to be more easily cached in web browsers, proxy servers etc. Unfortunately, some PHP servers don\'t allow this method, so if you have trouble viewing uploaded files or images (eg user pictures), disable this setting.'; $string['configsmartpix'] = 'With this on, icons are served through a PHP script that searches the current theme, then all parent themes, then the Moodle /pix folder. This reduces the need to duplicate image files within themes, but has a slight performance cost.'; -$string['configsmtpmaxbulk'] = 'Send multiple messages in one SMTP session, this may speed up sending of emails.'; +$string['configsmtpmaxbulk'] = 'Maximum number of messages sent per SMTP session. Grouping messages may speed up the sending of emails. Values lower than 2 force creation of new SMTP session for each email.'; $string['configsmtphosts'] = 'Give the full name of one or more local SMTP servers that Moodle should use to send mail (eg \'mail.a.com\' or \'mail.a.com;mail.b.com\'). If you leave it blank, Moodle will use the PHP default method of sending mail.'; $string['configsmtpuser'] = 'If you have specified an SMTP server above, and the server requires authentication, then enter the username and password here.'; $string['configstartwday'] = 'Start of Week'; @@ -627,7 +627,7 @@ $string['sitesectionhelp'] = 'If selected, a topic section will be displayed on $string['slasharguments'] = 'Use slash arguments'; $string['smartpix'] ='Smart pix search'; $string['smtphosts'] = 'SMTP hosts'; -$string['smtpmaxbulk'] = 'SMTP bulk sending'; +$string['smtpmaxbulk'] = 'SMTP session limit'; $string['smtppass'] = 'SMTP password'; $string['smtpuser'] = 'SMTP username'; $string['stats'] = 'Statistics'; diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 71d0b39cf6..b06de5ba22 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -3799,7 +3799,7 @@ function &get_mailer($action='get') { static $counter = 0; if (!isset($CFG->smtpmaxbulk)) { - $CFG->smtpmaxbulk = 0; + $CFG->smtpmaxbulk = 1; } if ($action == 'get') { @@ -3835,7 +3835,7 @@ function &get_mailer($action='get') { include_once($CFG->libdir.'/phpmailer/class.phpmailer.php'); $mailer = new phpmailer(); - $counter = 0; + $counter = 1; $mailer->Version = 'Moodle '.$CFG->version; // mailer version $mailer->PluginDir = $CFG->libdir.'/phpmailer/'; // plugin directory (eg smtp plugin)