]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13239 improved smtp bulk setting based on feedback from Gary; merged from MOODLE_...
authorskodak <skodak>
Sat, 2 Feb 2008 16:22:47 +0000 (16:22 +0000)
committerskodak <skodak>
Sat, 2 Feb 2008 16:22:47 +0000 (16:22 +0000)
admin/settings/server.php
lang/en_utf8/admin.php
lib/moodlelib.php

index 6fc9d2a53d156d8090c44ff9186c2560fda74c9b..ad811870c53b6ad98acfb1e0a83df63b51b16513 100644 (file)
@@ -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',
index 195ad0140b1f54666cd4b17389bc6860c1e05bf1..2b36ab512aaacef09cbcd5ea9152d07518619665 100644 (file)
@@ -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';
index 71d0b39cf69499b0782baa77dbf9502e0769da47..b06de5ba22ae352612d12677dbf96095b1697205 100644 (file)
@@ -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)