next up previous contents
Next: 問題九 Up: 問題解決 Previous: 問題七   Contents

問題八

  1. 學生繳交作業時,moodle 會寄出一封信給學生自己,但寄信者 From 部分為空白,因此,被 Yahoo 退信。,遠端回應訊息如下:
    遠端MTA回應的錯誤訊息:
    
    554 <xxxxxxxx@yahoo.com>...5.7.9 Message not accepted for policy reasons.
    See http://postmaster.yahoo.com/errors/postmaster-28.html
    
  2. 修改程式 lib/moodlelib.php:將寄信者設定為 noreply。
    [root@dywang moodle23]# diff -uN ../moodle/lib/moodlelib.php lib/moodlelib.php 
    --- ../moodle/lib/moodlelib.php	2012-08-10 08:05:01.000000000 +0800
    +++ lib/moodlelib.php	2014-09-05 13:48:47.965062189 +0800
    @@ -5293,7 +5298,9 @@
             $mail->From     = $CFG->noreplyaddress;
             $mail->FromName = $from;
         } else if ($usetrueaddress and $from->maildisplay) {
    -        $mail->From     = $from->email;
    +        // Changing this due to new DMARC policy requirements
    +        $mail->From     = $CFG->noreplyaddress;
             $mail->FromName = fullname($from);
         } else {
             $mail->From     = $CFG->noreplyaddress;
    



2017-08-04