next up previous contents
Next: configtest.php Up: 目錄 src Previous: addressbook.php   Contents

compose.php

  1. 撰寫新郵件程式。
    [root@mail squirrelmail-1.4.8]# diff -wuN ./src/compose.php /var/www/squirrelmail/src/compose.php
    --- ./src/compose.php	2006-08-03 22:48:09.000000000 +0800
    +++ /var/www/squirrelmail/src/compose.php	2014-07-21 08:00:13.813566843 +0800
    
  2. 修改自動簽名分隔符號。
    @@ -529,7 +553,8 @@
            }
            $signature = getSig($data_dir, $username, $no);
         }
    -    $body .= "\n\n".($prefix_sig==true? "-- \n":'').$signature;
    +	$prefixsig = "++++++++++++++++++++++"; //dywang
    +    $body .= "\n\n".($prefix_sig==true? $prefixsig."\n" :'').$signature."\n".$prefixsig;
         if ($compose_new_win == '1') {
             compose_Header($color, $mailbox);
         } else {
    
  3. 修改郵件本文編碼,並刪除多餘空白行。
    @@ -691,9 +716,12 @@
                     $actual = 'us-ascii';
                 }
     
    -            if ( $actual && is_conversion_safe($actual) && $actual != $default_charset){
    -                $bodypart = charset_convert($actual,$bodypart,$default_charset,false);
    -            }
    +			$bodypart = utf8convert($bodypart,$actural);  //dywang
    +			$bodypart = preg_replace("/(\r?\n)\\1+/","\\1",$bodypart); //dywang
    +			$bodypart = preg_replace("/([\s]*<br>\n)+/","<br>\n",$bodypart); //dywang
     
                 $body .= $bodypart;
    
  4. 在送出的郵件主題加入編號提示。
    @@ -845,7 +874,9 @@
             sqsession_register($compose_messages, 'compose_messages');
             session_write_close();
             sqimap_logout($imapConnection);
    +		if(!stristr($subject,$default_charset))	$subject = $default_charset . $subject; //dywang
         }
         $ret = array( 'send_to' => $send_to,
                 'send_to_cc' => $send_to_cc,
                 'send_to_bcc' => $send_to_bcc,
    
  5. 修正附檔檔名編碼顯示的轉碼。
    @@ -882,7 +913,8 @@
                         $filename = $message->getFilename();
                         break;
                 }
    -            $filename = decodeHeader($filename, false, false);
    +            $filename = decodeHeader($filename,false,false,true); //dywang must debug 
    +			$filename = utf8convert($filename,'');
                 if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
                         function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
                     $filename =  $languages[$squirrelmail_language]['XTRA_CODE']('encode', $filename);
    
  6. 修改郵件簽名分隔符號。
    @@ -958,6 +990,7 @@
             $username, $compose_messages, $composesession, $default_charset,
             $javascript_on;
     
    +	$prefixsig = "++++++++++++++++++++++"; //dywang
         if ($javascript_on)
             $onfocus = ' onfocus="alreadyFocused=true;"';
         else
    
  7. 修正郵件傳送位址上的編碼。
    @@ -973,9 +1006,9 @@
             $body = $values['body'];
             $identity = (int) $values['identity'];
         } else {
    -        $send_to = decodeHeader($send_to, true, false);
    -        $send_to_cc = decodeHeader($send_to_cc, true, false);
    -        $send_to_bcc = decodeHeader($send_to_bcc, true, false);
    +        $send_to = decodeHeader($send_to, true, false,true); //dywang
    +        $send_to_cc = decodeHeader($send_to_cc, true, false,true);
    +        $send_to_bcc = decodeHeader($send_to_bcc, true, false,true);
         }
     
         if ($use_javascript_addr_book) {
    
  8. 修正郵件自動簽名顯示方式。
    @@ -1132,18 +1167,18 @@
     
             if ($sig_first == '1') {
                 if ($default_charset == 'iso-2022-jp') {
    -                echo "\n\n".($prefix_sig==true? "-- \n":'').mb_convert_encoding($signature, 'EUC-JP');
    +                echo "\n\n\n".($prefix_sig==true? $prefixsig."\n":'').mb_convert_encoding($signature, 'EUC-JP')."\n".$prefixsig;
                 } else {
    -                echo "\n\n".($prefix_sig==true? "-- \n":'').decodeHeader($signature,false,false,true);
    +                echo "\n\n\n".($prefix_sig==true? $prefixsig."\n":'').decodeHeader($signature,false,false,true)."\n".$prefixsig;
                 }
                 echo "\n\n".htmlspecialchars(decodeHeader($body,false,false,true));
             }
             else {
    -            echo "\n\n".htmlspecialchars(decodeHeader($body,false,false,true));
    +            echo "\n\n\n".htmlspecialchars(decodeHeader($body,false,false,true));
                 if ($default_charset == 'iso-2022-jp') {
    -                echo "\n\n".($prefix_sig==true? "-- \n":'').mb_convert_encoding($signature, 'EUC-JP');
    +                echo "\n".($prefix_sig==true? $prefixsig."\n":'').mb_convert_encoding($signature, 'EUC-JP')."\n".$prefixsig;
                 }else{
    -                echo "\n\n".($prefix_sig==true? "-- \n":'').decodeHeader($signature,false,false,true);
    +                echo "\n".($prefix_sig==true? $prefixsig."\n":'').decodeHeader($signature,false,false,true)."\n".$prefixsig;
                 }
             }
         } else {
    
  9. 修正附件抬頭編碼顯示。
    @@ -1213,7 +1248,8 @@
                 foreach ($composeMessage->entities as $key => $attachment) {
                     $attached_file = $attachment->att_local_name;
                     if ($attachment->att_local_name || $attachment->body_part) {
    -                    $attached_filename = decodeHeader($attachment->mime_header->getParameter('name'));
    +                    $attached_filename = decodeHeader($attachment->mime_header->getParameter('name'),false,false,true);//dywang
                         $type = $attachment->mime_header->type0.'/'.
                             $attachment->mime_header->type1;
    



2016-03-11