Index: lib.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/forum/lib.php,v retrieving revision 1.903 diff -r1.903 lib.php 506a507 > $userto->msgprocessors = array(); 640c641,659 < $mailresult = message_send($eventdata); --- > // Quick hack for MDL-24516, as far as messaging API is highly ineficient > // and is discarding all the custom email headers, we are going to route > // messages to it only in case the user hasn't 'mail' as processor. With > // mail, we use email_to_user() here instead of messaging API > // TODO: This needs to be fixed properly in the msg API!! Critical!! > > // Try to get user default processors for mod_forum_post > $preferencename = 'message_provider_'.$eventdata->component.'_'.$eventdata->name.'_'.$userstate; > $processor = get_user_preferences($preferencename, NULL, $eventdata->userto->id); > $processorlist = explode(',', $processor); > // If any of the processors is email, use email_to_user(), ignoring msg API completely > if (in_array('email', $processorlist)) { > $mailresult = email_to_user($userto, $userfrom, $postsubject, $posttext, > $posthtml, '', '', $CFG->forum_replytouser); > > // Not having email as processor for mod_forum_post, route it to the msg API > } else { > $mailresult = message_send($eventdata); > } 926,928c945,946 < $attachment = $attachname=''; < $usetrueaddress = true; < $mailresult = email_to_user($userto, $site->shortname, $postsubject, $posttext, $posthtml, $attachment, $attachname, $usetrueaddress, $CFG->forum_replytouser); --- > $mailresult = email_to_user($userto, $site->shortname, $postsubject, $posttext, $posthtml, > '', '', $CFG->forum_replytouser);