next up previous contents
Next: redirect.php Up: 目錄 src Previous: printer_friendly_main.php   Contents

read_body.php

  1. 讀取郵件本文程式。
    [root@mail squirrelmail-1.4.8]# diff -wuN ./src/read_body.php /var/www/squirrelmail/src/read_body.php
    --- ./src/read_body.php	2006-08-01 13:47:32.000000000 +0800
    +++ /var/www/squirrelmail/src/read_body.php	2014-02-12 17:09:17.655390410 +0800
    
  2. 修改收信者編碼解碼參數。
    @@ -227,7 +227,7 @@
         $now = getLongDateString( time() );
         set_my_charset();
         $body = _("Your message") . "\r\n\r\n" .
    -            "\t" . _("To") . ': ' . decodeHeader($to,false,false,true) . "\r\n" .
    +            "\t" . _("To") . ': ' . decodeHeader($to,false,true,true) . "\r\n" .  //dywang
                 "\t" . _("Subject") . ': ' . decodeHeader($header->subject,false,false,true) . "\r\n" .
                 "\t" . _("Sent") . ': ' . $senton . "\r\n" .
                 "\r\n" .
    
  3. 修改增加收信者編碼解碼參數。
    @@ -385,7 +385,7 @@
     
             $cnt = count($recipients);
             foreach($recipients as $r) {
    -            $add = decodeHeader($r->getAddress(true));
    +            $add = decodeHeader($r->getAddress(true),false,true,true); //dywang
                 if ($string) {
                     $string .= '<br />' . $add;
                 } else {
    
  4. 修改郵件主題編碼解碼參數。
    @@ -413,7 +413,7 @@
     
         $header = $message->rfc822_header;
         $env = array();
    -    $env[_("Subject")] = decodeHeader($header->subject);
    +    $env[_("Subject")] = decodeHeader($header->subject,false,false,true); //dywang
         $from_name = $header->getAddr_s('from');
         if (!$from_name) {
             $from_name = $header->getAddr_s('sender');
    
  5. 修改來信者編碼解碼參數。
    @@ -421,7 +421,7 @@
                 $from_name = _("Unknown sender");
             }
         }
    -    $env[_("From")] = decodeHeader($from_name);
    +    $env[_("From")] = decodeHeader($from_name,false,true,true); //dywang
         $env[_("Date")] = getLongDateString($header->date);
         $env[_("To")] = formatRecipientString($header->to, "to");
         $env[_("Cc")] = formatRecipientString($header->cc, "cc");
    
  6. 修改寄信者編碼解碼參數。
    @@ -430,7 +430,7 @@
             $env[_("Priority")] = htmlspecialchars(getPriorityStr($header->priority));
         }
         if ($show_xmailer_default) {
    -        $env[_("Mailer")] = decodeHeader($header->xmailer);
    +        $env[_("Mailer")] = decodeHeader($header->xmailer,false,false,true);
         }
         if ($default_use_mdn) {
             if ($mdn_user_support) {
    
  7. 刪除郵件本文中多餘的空白行及空白。
    @@ -817,6 +817,12 @@
        }
     }
     
    +$messagebody = preg_replace("/(\r?\n)\\1+/","\\1",$messagebody); //dywang
    +$messagebody = preg_replace("/([\s]*<br>\n)+/","<br>\n",$messagebody); //dywang
     displayPageHeader($color, $mailbox);
     formatMenuBar($mailbox, $passed_id, $passed_ent_id, $message, $mbx_response);
     formatEnvheader($mailbox, $passed_id, $passed_ent_id, $message, $color, $FirstTimeSee);
    
  8. 加入郵件本文自動換行顯示功能,並設定顯示寬度。
    @@ -824,11 +830,11 @@
     echo '  <tr><td>';
     echo '    <table width="100%" cellpadding="1" cellspacing="0" align="center" border="0" bgcolor="'.$color[9].'">';
     echo '      <tr><td>';
    -echo '        <table width="100%" cellpadding="3" cellspacing="0" align="center" border="0">';
    -echo '          <tr bgcolor="'.$color[4].'"><td>';
    +echo '        <table width="100%" style="word-break:break-all" cellpadding="3" cellspacing="0" align="center" border="0">';
    +echo '          <tr bgcolor="'.$color[4].'"><td>'; //dywang style="word-break:break-all"
     // echo '            <table cellpadding="1" cellspacing="5" align="left" border="0">';
     echo html_tag( 'table' ,'' , 'left', '', 'cellpadding="1" cellspacing="5" border="0"' );
    -echo '              <tr>' . html_tag( 'td', '<br />'. $messagebody."\n", 'left')
    +echo '              <tr>' . html_tag( 'td', '<br />'. $messagebody."\n", 'left','','width=1080') //dywang
                             . '</tr>';
     echo '            </table>';
     echo '          </td></tr>';
    



2016-03-11