Index: admin/settings/server.php =================================================================== --- admin/settings/server.php (revision 16562) +++ admin/settings/server.php (working copy) @@ -71,6 +71,7 @@ $temp->add(new admin_setting_configtext('supportname', get_string('supportname', 'admin'), get_string('configsupportname', 'admin'), $primaryadminname, PARAM_NOTAGS)); $temp->add(new admin_setting_configtext('supportemail', get_string('supportemail', 'admin'), get_string('configsupportemail', 'admin'), $primaryadminemail, PARAM_NOTAGS)); $temp->add(new admin_setting_configtext('supportpage', get_string('supportpage', 'admin'), get_string('configsupportpage', 'admin'), '', PARAM_URL)); +$temp->add(new admin_setting_configcheckbox('supportemailoverride', get_string('supportemailoverride', 'admin'), get_string('configsupportemailoverride', 'admin'), 0)); $ADMIN->add('server', $temp, 100); Index: lang/en_utf8/admin.php =================================================================== --- lang/en_utf8/admin.php (revision 16562) +++ lang/en_utf8/admin.php (working copy) @@ -262,6 +262,7 @@ $string['configstatsuserthreshold'] = 'If you enter a non-zero, non numeric value here, for ranking courses, courses with less than this number of enrolled users (all roles) will be ignored'; $string['configstripalltitletags'] = 'Uncheck this setting to allow HTML tags in activity and resource names.'; $string['configsupportemail'] = 'This email address will be published to users of this site as the one to email when they need general help (for example, when new users create their own accounts). If this email is left blank then no such helpful email address is supplied.'; +$string['configsupportemailoverride'] = 'This setting will override system emails being sent from the main admin user with the Support Name and Support Email settings above. This is useful to make welcome messages and other automated emails appear to come from a Helpdesk or generic sender instead of the main Moodle admin.'; $string['configsupportname'] = 'This is the name of a person or other entity offering general help via the support email or web address.'; $string['configsupportpage'] = 'This web address will be published to users of this site as the one to go to when they need general help (for example, when new users create their own accounts). If this address is left blank then no link will be supplied.'; $string['configteacherassignteachers'] = 'Should ordinary teachers be allowed to assign other teachers within courses they teach? If \'No\', then only course creators and admins can assign teachers.'; @@ -736,6 +737,7 @@ $string['stickyblockspagetype'] = 'Page type to configure'; $string['stripalltitletags'] = 'Remove HTML tags from all activity names'; $string['supportemail'] = 'Support email'; +$string['supportemailoverride'] = 'Support Email Sender Override'; $string['supportname'] = 'Support name'; $string['supportpage'] = 'Support page'; $string['switchlang'] = 'Switch lang directory'; Index: lib/moodlelib.php =================================================================== --- lib/moodlelib.php (revision 16562) +++ lib/moodlelib.php (working copy) @@ -4279,6 +4279,12 @@ $supportuser = generate_email_supportuser(); + // MDL-25476 + // Allow option for system emails to be sent from support user instead of admin + if (!empty($CFG->supportemailoverride) && $from == get_admin()) { + $from = $supportuser; + } + // make up an email address for handling bounces if (!empty($CFG->handlebounces)) { $modargs = 'B'.base64_encode(pack('V',$user->id)).substr(md5($user->email),0,16);