-
Bug
-
Resolution: Not a bug
-
Minor
-
None
-
3.8, 4.0.5, 4.1
-
6
-
Team Hedgehog Sprint 1.2, Team Hedgehog Sprint 1.3
When using email_to_user() function and setting smtpmaxbulk > 1 the connection is always closed after sending each email.
I attached mailtest script which will have to alter path to config.php
Create a moodle test instance
Make a xs test course from developer setting page
Run script
sudo php admin/toolbox/cli/mailtest.php --smtpmaxbulk=100 | tee somefile
Sending 100 emails with 'smtpmaxbulk' set at 1 against Moodle version 3.8
Took (350.826794) seconds
Sending 100 emails with 'smtpmaxbulk' set at 100 against Moodle version 3.8
Took (352.816759) seconds
When hacking getmailer function to force SMTP to keepalive performance is better $prevkeepalive = true;
https://github.com/moodle/moodle/blob/MOODLE_38_STABLE/lib/moodlelib.php#L5782
Sending 100 emails with 'smtpmaxbulk' set at 100 against Moodle version 3.8
Took (130.510947) seconds