diff -uNrw -x CVS squirrelmail-1.4.3a/class/deliver/Deliver.class.php squirrelmail-1.4.3a-ja/class/deliver/Deliver.class.php
--- squirrelmail-1.4.3a/class/deliver/Deliver.class.php	2004-05-05 06:57:28.000000000 +0900
+++ squirrelmail-1.4.3a-ja/class/deliver/Deliver.class.php	2004-06-01 23:23:02.000000000 +0900
@@ -381,7 +381,7 @@
         $date = date('D, j M Y H:i:s ', mktime()) . $this->timezone();
         /* Create a message-id */
         $message_id = '<' . $REMOTE_PORT . '.' . $REMOTE_ADDR . '.';
-        $message_id .= time() . '.squirrel@' . $REMOTE_ADDR .'>';
+        $message_id .= time() . '.squirrel@' . $SERVER_NAME .'>';
         /* Make an RFC822 Received: line */
         if (isset($REMOTE_HOST)) {
             $received_from = "$REMOTE_HOST ([$REMOTE_ADDR])";
@@ -602,6 +602,9 @@
                     default: break;
                     }
 
+                    if (substr($line_tmp, $iFoldPos, 2) == '=?') {
+                        $iFoldPos--;
+                    }
                     if (!$iFoldPos) { /* clean folding didn't work */
                         $iFoldPos = $length;
                     }
diff -uNrw -x CVS squirrelmail-1.4.3a/class/mime/Rfc822Header.class.php squirrelmail-1.4.3a-ja/class/mime/Rfc822Header.class.php
--- squirrelmail-1.4.3a/class/mime/Rfc822Header.class.php	2004-02-29 00:00:49.000000000 +0900
+++ squirrelmail-1.4.3a-ja/class/mime/Rfc822Header.class.php	2004-05-31 08:29:47.000000000 +0900
@@ -39,10 +39,11 @@
                                     in smtp.php */
     function parseHeader($hdr) {
         if (is_array($hdr)) {
+            array_shift($hdr);array_pop($hdr);
             $hdr = implode('', $hdr);
         }
-        /* First we replace \r\n by \n and unfold the header */
-        $hdr = trim(str_replace(array("\r\n", "\n\t", "\n "),array("\n", ' ', ' '), $hdr));
+        /* First we unfold the header */
+        $hdr = trim(preg_replace("/\r\n\s+/", '', $hdr));
 
         /* Now we can make a new header array with */
         /* each element representing a headerline  */
diff -uNrw -x CVS squirrelmail-1.4.3a/config/.cvsignore squirrelmail-1.4.3a-ja/config/.cvsignore
--- squirrelmail-1.4.3a/config/.cvsignore	1970-01-01 09:00:00.000000000 +0900
+++ squirrelmail-1.4.3a-ja/config/.cvsignore	2003-10-07 23:40:55.000000000 +0900
@@ -0,0 +1 @@
+config.php
diff -uNrw -x CVS squirrelmail-1.4.3a/functions/date.php squirrelmail-1.4.3a-ja/functions/date.php
--- squirrelmail-1.4.3a/functions/date.php	2004-05-05 09:34:14.000000000 +0900
+++ squirrelmail-1.4.3a-ja/functions/date.php	2004-06-03 09:28:28.000000000 +0900
@@ -348,8 +348,8 @@
     if ($invert_time) {
         $dateZ = - $dateZ;
     }
-    $midnight = $now - ($now % 86400) - $dateZ;
-    $nextmid = $midnight + 86400 - $dateZ;
+    $midnight = $now - ($now + $dateZ) % 86400;
+    $nextmid = $midnight + 86400;
     
     if (($show_full_date == 1) || ($nextmid < $stamp)) {
         $date_format = _("M j, Y");
diff -uNrw -x CVS squirrelmail-1.4.3a/functions/i18n.php squirrelmail-1.4.3a-ja/functions/i18n.php
--- squirrelmail-1.4.3a/functions/i18n.php	2004-05-20 00:57:23.000000000 +0900
+++ squirrelmail-1.4.3a-ja/functions/i18n.php	2004-05-31 09:35:44.000000000 +0900
@@ -21,9 +21,8 @@
 function charset_decode ($charset, $string) {
     global $languages, $squirrelmail_language;
 
-    if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
-        function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
-        $string = $languages[$squirrelmail_language]['XTRA_CODE']('decode', $string);
+    if ($charset == 'iso-2022-jp' || $squirrelmail_language == 'ja_JP') {
+        $string = $languages['ja_JP']['XTRA_CODE']('decode', $string);
     }
 
     /* All HTML special characters are 7 bit and can be replaced first */
@@ -86,6 +85,11 @@
         } else {
             $ret = charset_decode_iso_8859_default ($string);
         }
+    } else if ($charset == 'iso-2022-jp') {
+        if ($squirrelmail_language != 'ja_JP') {
+			include_once(SM_PATH . 'functions/decode/utf-8.php');
+            $ret = charset_decode_utf8 (@mb_convert_encoding($string, 'UTF-8', 'AUTO'));
+        }
     } else if ($charset == 'ns_4551-1') {
         $ret = charset_decode_ns_4551_1 ($string);
     } else if ($charset == 'koi8-r') {
@@ -593,23 +597,25 @@
     if (function_exists('mb_detect_encoding')) {
         switch (func_get_arg(0)) { /* action */
         case 'decode':
-            $detect_encoding = @mb_detect_encoding($ret);
-            if ($detect_encoding == 'JIS' ||
-                $detect_encoding == 'EUC-JP' ||
-                $detect_encoding == 'SJIS' ||
-                $detect_encoding == 'UTF-8') {
+            if (strpos($ret, chr(27)) !== FALSE) {
+                $ret = mb_convert_kana(mb_convert_encoding($ret, 'EUC-JP', 'JIS'), "KV");
+            } else {
+                $detect_encoding = strtolower(@mb_detect_encoding($ret));
+            if ($detect_encoding == 'jis' ||
+                $detect_encoding == 'sjis' ||
+                $detect_encoding == 'utf-8') {
                 
-                $ret = mb_convert_kana(mb_convert_encoding($ret, 'EUC-JP', 'AUTO'), "KV");
+                $ret = mb_convert_kana(mb_convert_encoding($ret, 'EUC-JP', $detect_encoding), "KV");
+            }
             }
             break;
         case 'encode':
-            $detect_encoding = @mb_detect_encoding($ret);
-            if ($detect_encoding == 'JIS' ||
-                $detect_encoding == 'EUC-JP' ||
-                $detect_encoding == 'SJIS' ||
-                $detect_encoding == 'UTF-8') {
+            $detect_encoding = strtolower(@mb_detect_encoding($ret));
+            if ($detect_encoding == 'euc-jp' ||
+                $detect_encoding == 'sjis' ||
+                $detect_encoding == 'utf-8') {
                 
-                $ret = mb_convert_encoding(mb_convert_kana($ret, "KV"), 'JIS', 'AUTO');
+                $ret = mb_convert_encoding(mb_convert_kana($ret, "KV"), 'JIS', $detect_encoding);
             }
             break;
         case 'strimwidth':
@@ -618,6 +624,7 @@
             break;
         case 'encodeheader':
             $result = '';
+            $ret = mb_convert_kana($ret, "KV");
             if (strlen($ret) > 0) {
                 $tmpstr = mb_substr($ret, 0, 1);
                 $prevcsize = strlen($tmpstr);
@@ -647,18 +654,19 @@
             $ret = $result;
             break;
         case 'decodeheader':
-            $ret = str_replace("\t", "", $ret);
-            if (eregi('=\\?([^?]+)\\?(q|b)\\?([^?]+)\\?=', $ret))
+            if (eregi('=\\?([^?]+)\\?(q|b)\\?([^?]+)\\?=', $ret)) {
                 $ret = @mb_decode_mimeheader($ret);
-            $ret = @mb_convert_encoding($ret, 'EUC-JP', 'AUTO');
+            } elseif (strpos($ret, chr(27)) !== FALSE) {
+                $ret = mb_convert_kana(mb_convert_encoding($ret, 'EUC-JP', 'JIS'), "KV");
+            }
             break;
         case 'downloadfilename':
             $useragent = func_get_arg(2);
             if (strstr($useragent, 'Windows') !== false ||
                 strstr($useragent, 'Mac_') !== false) {
-                $ret = mb_convert_encoding($ret, 'SJIS', 'AUTO');
+                $ret = @mb_convert_encoding($ret, 'SJIS', 'AUTO');
             } else {
-                $ret = mb_convert_encoding($ret, 'EUC-JP', 'AUTO');
+                $ret = @mb_convert_encoding($ret, 'EUC-JP', 'AUTO');
 }
             break;
         case 'wordwrap':
diff -uNrw -x CVS squirrelmail-1.4.3a/functions/imap_search.php squirrelmail-1.4.3a-ja/functions/imap_search.php
--- squirrelmail-1.4.3a/functions/imap_search.php	2004-02-25 00:57:26.000000000 +0900
+++ squirrelmail-1.4.3a-ja/functions/imap_search.php	2004-05-31 08:29:47.000000000 +0900
@@ -45,7 +45,7 @@
     if ($imap_server_type == 'macosx') {
         foreach ($multi_search as $multi_search_part) {
             if (strtoupper($languages[$squirrelmail_language]['CHARSET']) == 'ISO-2022-JP') {
-                $multi_search_part = mb_convert_encoding($multi_search_part, 'JIS', 'auto');
+                $multi_search_part = mb_convert_encoding($multi_search_part, 'JIS', 'EUC-JP');
             }
             $search_string .= $search_where . ' ' .$multi_search_part . ' ';
         }
@@ -53,7 +53,7 @@
     else {
         foreach ($multi_search as $multi_search_part) {
             if (strtoupper($languages[$squirrelmail_language]['CHARSET']) == 'ISO-2022-JP') {
-                $multi_search_part = mb_convert_encoding($multi_search_part, 'JIS', 'auto');
+                $multi_search_part = mb_convert_encoding($multi_search_part, 'JIS', 'EUC-JP');
             }
             $search_string .= $search_where . ' {' . strlen($multi_search_part)
                 . "}\r\n" . $multi_search_part . ' ';
diff -uNrw -x CVS squirrelmail-1.4.3a/functions/mime.php squirrelmail-1.4.3a-ja/functions/mime.php
--- squirrelmail-1.4.3a/functions/mime.php	2004-05-24 01:14:11.000000000 +0900
+++ squirrelmail-1.4.3a-ja/functions/mime.php	2004-05-31 08:29:47.000000000 +0900
@@ -160,7 +160,7 @@
 
     /* Don't kill the connection if the browser is over a dialup
      * and it would take over 30 seconds to download it.
-     * Don´t call set_time_limit in safe mode.
+     * DonŽ´t call set_time_limit in safe mode.
      */
 
     if (!ini_get('safe_mode')) {
@@ -265,16 +265,27 @@
 function translateText(&$body, $wrap_at, $charset) {
     global $where, $what;   /* from searching */
     global $color;          /* color theme */
+    global $languages, $squirrelmail_language;
 
     require_once(SM_PATH . 'functions/url_parser.php');
 
+    if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
+        function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
+        $body = $languages[$squirrelmail_language]['XTRA_CODE']('decode', $body);
+    }
+
     $body_ary = explode("\n", $body);
     for ($i=0; $i < count($body_ary); $i++) {
         $line = $body_ary[$i];
         if (strlen($line) - 2 >= $wrap_at) {
             sqWordWrap($line, $wrap_at);
         }
+        if ($squirrelmail_language == 'ja_JP') {
+            $line = htmlspecialchars($line);
+        } else {
         $line = charset_decode($charset, $line);
+        }
+
         $line = str_replace("\t", '        ', $line);
 
         parseUrl ($line);
@@ -529,7 +540,7 @@
 
 /* This function decodes the body depending on the encoding type. */
 function decodeBody($body, $encoding) {
-    global $show_html_default;
+    global $show_html_default, $squirrelmail_language;
 
     $body = str_replace("\r\n", "\n", $body);
     $encoding = strtolower($encoding);
@@ -546,9 +557,11 @@
         $encoding == 'quoted_printable') {
         $body = quoted_printable_decode($body);
 
+		if ($squirrelmail_language != 'ja_JP') {
         while (ereg("=\n", $body)) {
             $body = ereg_replace ("=\n", '', $body);
         }
+		}
 
     } else if ($encoding == 'base64') {
         $body = base64_decode($body);
@@ -574,6 +587,11 @@
         $string = $languages[$squirrelmail_language]['XTRA_CODE']('decodeheader', $string);
         // Do we need to return at this point?
         // return $string;
+        if ($htmlsave) {
+            return htmlspecialchars($string);
+        } else {
+            return $string;
+        }
     }
     $i = 0;
     $iLastMatch = -2;
@@ -1328,6 +1346,12 @@
         sq_unspace($attvalue);
 
         /**
+		 * Remove \r \n \t \0 " " "\\"
+		 */
+		$attvalue = str_replace(Array("\r", "\n", "\t", "\0", " ", "\\"), 
+								Array('', '','','','',''), $attvalue);
+
+        /**
          * Now let's run checks on the attvalues.
          * I don't expect anyone to comprehend this. If you do,
          * get in touch with me so I can drive to where you live and
diff -uNrw -x CVS squirrelmail-1.4.3a/functions/url_parser.php squirrelmail-1.4.3a-ja/functions/url_parser.php
--- squirrelmail-1.4.3a/functions/url_parser.php	2004-02-25 00:57:26.000000000 +0900
+++ squirrelmail-1.4.3a-ja/functions/url_parser.php	2004-05-31 08:29:48.000000000 +0900
@@ -72,6 +72,8 @@
     '.&nbsp;', '&nbsp;', ')', '(', '&quot;', '&lt;', '&gt;', '.<', 
     ']', '[', '{', '}', "\240", ', ', '. ', ",\n", ",\r");
 
+for ($chr = 0xa1; $chr <= 0xfe; $chr++)  // EUC-JP 1st byte
+     $url_parser_poss_ends[] = chr($chr);
 
 function parseUrl (&$body) {
     global $url_parser_poss_ends, $url_parser_url_tokens;;
¥Ð¥¤¥Ê¥ê¡¼¡¦¥Õ¥¡¥¤¥ësquirrelmail-1.4.3a/locale/ja_JP/LC_MESSAGES/squirrelmail.mo¤Èsquirrelmail-1.4.3a-ja/locale/ja_JP/LC_MESSAGES/squirrelmail.mo¤Ï°ã¤¤¤Þ¤¹
diff -uNrw -x CVS squirrelmail-1.4.3a/locale/ja_JP/LC_MESSAGES/squirrelmail.po squirrelmail-1.4.3a-ja/locale/ja_JP/LC_MESSAGES/squirrelmail.po
--- squirrelmail-1.4.3a/locale/ja_JP/LC_MESSAGES/squirrelmail.po	2004-04-29 03:07:16.000000000 +0900
+++ squirrelmail-1.4.3a-ja/locale/ja_JP/LC_MESSAGES/squirrelmail.po	2004-05-31 08:29:48.000000000 +0900
@@ -7,7 +7,7 @@
 "Project-Id-Version: squirrelmail 1.4.3cvs\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2004-04-21 09:34+0300\n"
-"PO-Revision-Date: 2004-04-27 22:58+0900\n"
+"PO-Revision-Date: 2004-05-19 17:59+0900\n"
 "Last-Translator: Masato HIGASHIYAMA <masato@yamaai-tech.com>\n"
 "Language-Team: Japanese  <squirrelmail-i18n@lists.sourceforge.net>\n"
 "MIME-Version: 1.0\n"
@@ -903,40 +903,40 @@
 msgstr "ÅÚ"
 
 msgid "January"
-msgstr " 1·î"
+msgstr " 1"
 
 msgid "February"
-msgstr " 2·î"
+msgstr " 2"
 
 msgid "March"
-msgstr " 3·î"
+msgstr " 3"
 
 msgid "April"
-msgstr " 4·î"
+msgstr " 4"
 
 msgid "May"
-msgstr " 5·î"
+msgstr " 5"
 
 msgid "June"
-msgstr " 6·î"
+msgstr " 6"
 
 msgid "July"
-msgstr " 7·î"
+msgstr " 7"
 
 msgid "August"
-msgstr " 8·î"
+msgstr " 8"
 
 msgid "September"
-msgstr " 9·î"
+msgstr " 9"
 
 msgid "October"
-msgstr "10·î"
+msgstr "10"
 
 msgid "November"
-msgstr "11·î"
+msgstr "11"
 
 msgid "December"
-msgstr "12·î"
+msgstr "12"
 
 msgid "Jan"
 msgstr " 1"
diff -uNrw -x CVS squirrelmail-1.4.3a/plugins/calendar/calendar.php squirrelmail-1.4.3a-ja/plugins/calendar/calendar.php
--- squirrelmail-1.4.3a/plugins/calendar/calendar.php	2004-02-25 00:57:29.000000000 +0900
+++ squirrelmail-1.4.3a-ja/plugins/calendar/calendar.php	2004-05-31 08:29:48.000000000 +0900
@@ -116,8 +116,8 @@
                 $i=0;
                 while ($calfoo = each($calendardata[$cdate])) {
                     $calbar = $calendardata[$cdate][$calfoo['key']];
-                    $title = '['. $calfoo['key']. '] ' .$calbar['message'];
-                    echo ($calbar['priority']==1) ? "<a href=\"#\" style=\"text-decoration:none; color: $color[1]\" title=\"$title\">$calbar[title]</a><br>\n" : "<a href=\"#\" style=\"text-decoration:none; color: $color[6]\" title=\"$title\">$calbar[title]</a><br>\n";
+                    $title = '['. $calfoo['key']. '] ' . str_replace('&lt;br /&gt;', "\n", $calbar['message']);
+                    echo ($calbar['priority']==1) ? "<a href=\"#\" style=\"text-decoration:none; color: $color[1]\" title=\"$title\">".$calbar['title']."</a><br>\n" : "<a href=\"#\" style=\"text-decoration:none; color: $color[6]\" title=\"$title\">".$calbar['title']."</a><br>\n";
                     $i=$i+1;
                     if($i==2){
                         break;
diff -uNrw -x CVS squirrelmail-1.4.3a/plugins/calendar/day.php squirrelmail-1.4.3a-ja/plugins/calendar/day.php
--- squirrelmail-1.4.3a/plugins/calendar/day.php	2004-02-25 00:57:29.000000000 +0900
+++ squirrelmail-1.4.3a-ja/plugins/calendar/day.php	2004-05-31 08:29:48.000000000 +0900
@@ -130,7 +130,7 @@
                         html_tag( 'td', $ehour . ':' . $eminute . $elength, 'left' ) .
                         html_tag( 'td', '', 'left' ) . '[';
                             echo ($calbar['priority']==1) ? "<font color=\"$color[1]\">$calbar[title]</font>" : "$calbar[title]";
-                            echo"] $calbar[message]&nbsp;" .
+                            echo"] <br />" . str_replace('&lt;br /&gt;', '<br />', $calbar['message']) . "&nbsp;" .
                         html_tag( 'td',
                             "<font size=\"-1\"><nobr>\n" .
                             "<a href=\"event_edit.php?year=$year&amp;month=$month&amp;day=$day&amp;hour=".substr($calfoo['key'],0,2)."&amp;minute=".substr($calfoo['key'],2,2)."\">".
diff -uNrw -x CVS squirrelmail-1.4.3a/plugins/calendar/event_delete.php squirrelmail-1.4.3a-ja/plugins/calendar/event_delete.php
--- squirrelmail-1.4.3a/plugins/calendar/event_delete.php	2004-02-25 00:57:29.000000000 +0900
+++ squirrelmail-1.4.3a-ja/plugins/calendar/event_delete.php	2004-05-31 08:29:48.000000000 +0900
@@ -104,7 +104,8 @@
                ) .
                html_tag( 'tr',
                    html_tag( 'td', _("Message:"), 'right', $color[4] ) .
-                   html_tag( 'td', $tmparray['message'], 'left', $color[4] )
+                   html_tag( 'td', str_replace('&lt;br /&gt;', '<br />', $tmparray['message'])
+                             , 'left', $color[4] )
                ) .
                html_tag( 'tr',
                    html_tag( 'td',
diff -uNrw -x CVS squirrelmail-1.4.3a/plugins/calendar/event_edit.php squirrelmail-1.4.3a-ja/plugins/calendar/event_edit.php
--- squirrelmail-1.4.3a/plugins/calendar/event_edit.php	2004-02-25 00:57:29.000000000 +0900
+++ squirrelmail-1.4.3a-ja/plugins/calendar/event_edit.php	2004-05-31 08:29:48.000000000 +0900
@@ -156,7 +156,8 @@
          "      <INPUT TYPE=text NAME=\"event_title\" VALUE=\"$tmparray[title]\" SIZE=30 MAXLENGTH=50><BR>\n".
          "      </td></tr>\n".
          html_tag( 'td',
-             "      <TEXTAREA NAME=\"event_text\" ROWS=5 COLS=\"$editor_size\" WRAP=HARD>$tmparray[message]</TEXTAREA>\n" ,
+             "      <TEXTAREA NAME=\"event_text\" ROWS=5 COLS=\"$editor_size\" WRAP=HARD>" .
+                   str_replace('&lt;br /&gt;', "\n", $tmparray[message]) . "</TEXTAREA>\n" ,
          'left', $color[4], 'colspan="2"' ) .
          '</tr>' . html_tag( 'tr' ) .
          html_tag( 'td',
@@ -194,7 +195,8 @@
                 ) .
                 html_tag( 'tr',
                     html_tag( 'td', _("Message:") , 'right', $color[4] ) ."\n" .
-                    html_tag( 'td', $tmparray['message'] , 'left', $color[4] ) ."\n"
+                    html_tag( 'td', str_replace('&lt;br /&gt;', '<br />', $tmparray['message'])
+                              , 'left', $color[4] ) ."\n"
                 ) .
                 html_tag( 'tr',
                     html_tag( 'th', _("to:") . "<br>\n", '', $color[4], 'colspan="2"' ) ."\n"
@@ -218,7 +220,8 @@
                 ) .
                 html_tag( 'tr',
                     html_tag( 'td', _("Message:") , 'right', $color[4] ) ."\n" .
-                    html_tag( 'td', $event_text , 'left', $color[4] ) ."\n"
+                    html_tag( 'td', str_replace('&lt;br /&gt;', '<br />', $event_text)
+                              , 'left', $color[4] ) ."\n"
                 ) .
                 html_tag( 'tr',
                     html_tag( 'td',
diff -uNrw -x CVS squirrelmail-1.4.3a/plugins/delete_move_next/setup.php squirrelmail-1.4.3a-ja/plugins/delete_move_next/setup.php
--- squirrelmail-1.4.3a/plugins/delete_move_next/setup.php	2004-04-25 21:52:38.000000000 +0900
+++ squirrelmail-1.4.3a-ja/plugins/delete_move_next/setup.php	2004-05-31 08:29:48.000000000 +0900
@@ -71,6 +71,7 @@
 
 function delete_move_del_arr_elem($arr, $index) {
     $tmp = array();
+    if (count($arr)) {
     $j = 0;
     foreach ($arr as $v) {
         if ($j != $index) {
@@ -78,6 +79,7 @@
          }
          $j++;
     }
+    }
     return $tmp;
 }
 
diff -uNrw -x CVS squirrelmail-1.4.3a/plugins/filters/filters.php squirrelmail-1.4.3a-ja/plugins/filters/filters.php
--- squirrelmail-1.4.3a/plugins/filters/filters.php	2004-02-25 00:57:30.000000000 +0900
+++ squirrelmail-1.4.3a-ja/plugins/filters/filters.php	2004-05-31 08:29:48.000000000 +0900
@@ -262,6 +262,10 @@
         $what  = addslashes(trim($what[1]));
     }
 
+    if ($squirrelmail_language == 'ja_JP') {
+        $what = mb_convert_encoding($what, 'JIS', 'EUC-JP');
+    }
+
     if ($imap_server_type == 'macosx') {    
 	$search_str .= ' ' . $where . ' ' . $what;
     } else {
@@ -462,7 +466,7 @@
 
     $filters = array();
     for ($i=0; $fltr = getPref($data_dir, $username, 'filter' . $i); $i++) {
-        $ary = explode(',', $fltr);
+        $ary = explode(',', $fltr, 3);
         $filters[$i]['where'] = $ary[0];
         $filters[$i]['what'] = $ary[1];
         $filters[$i]['folder'] = $ary[2];
diff -uNrw -x CVS squirrelmail-1.4.3a/plugins/filters/options.php squirrelmail-1.4.3a-ja/plugins/filters/options.php
--- squirrelmail-1.4.3a/plugins/filters/options.php	2004-04-27 07:20:06.000000000 +0900
+++ squirrelmail-1.4.3a-ja/plugins/filters/options.php	2004-05-31 08:29:48.000000000 +0900
@@ -228,7 +228,7 @@
         echo ']</small></td>'.
             html_tag( 'td', '-', 'left' ) .
             html_tag( 'td', '', 'left' );
-        printf( _("If <b>%s</b> contains <b>%s</b> then move to <b>%s</b>"), $filters[$i]['where'], $filters[$i]['what'], $fdr );
+        printf( _("If <b>%s</b> contains <b>%s</b> then move to <b>%s</b>"), _($filters[$i]['where']), $filters[$i]['what'], imap_utf7_decode_local($fdr) );
         echo '</td></tr>';
 
     }
diff -uNrw -x CVS squirrelmail-1.4.3a/src/compose.php squirrelmail-1.4.3a-ja/src/compose.php
--- squirrelmail-1.4.3a/src/compose.php	2004-06-01 02:32:34.000000000 +0900
+++ squirrelmail-1.4.3a-ja/src/compose.php	2004-06-03 15:37:23.000000000 +0900
@@ -323,7 +323,7 @@
                 exit();
             }
             else {
-                Header("Location: $location/right_main.php?mailbox=$draft_folder&sort=$sort".
+                Header("Location: $location/right_main.php?mailbox=" . urlencode($draft_folder) . "&sort=$sort".
                        "&startMessage=1&note=".urlencode($draft_message));
                 exit();
             }
@@ -1428,12 +1428,17 @@
         $mime_header->type1 = 'plain';
         if ($special_encoding) {
             $mime_header->encoding = $special_encoding;
+			if ($special_encoding == '8bit') {
+				$mime_header->parameters['charset'] = 'us-ascii';
         } else {
-            $mime_header->encoding = '8bit';
+				$mime_header->parameters['charset']=$default_charset;
         }
+        } else {
+            $mime_header->encoding = '8bit';
         if ($default_charset) {
             $mime_header->parameters['charset'] = $default_charset;
         }
+        }
         $message_body->mime_header = $mime_header;
         array_unshift($composeMessage->entities, $message_body);
         $content_type = new ContentType('multipart/mixed');
@@ -1441,13 +1446,18 @@
         $content_type = new ContentType('text/plain');
         if ($special_encoding) {
             $rfc822_header->encoding = $special_encoding;
+			if ($special_encoding == '8bit') {
+				$content_type->properties['charset'] = 'us-ascii';
         } else {
-            $rfc822_header->encoding = '8bit';
+				$content_type->properties['charset']=$default_charset;
         }
+        } else {
+            $rfc822_header->encoding = '8bit';
         if ($default_charset) {
             $content_type->properties['charset']=$default_charset;
 	}
     }
+    }
 
     $rfc822_header->content_type = $content_type;
     $composeMessage->rfc822_header = $rfc822_header;
diff -uNrw -x CVS squirrelmail-1.4.3a/src/printer_friendly_bottom.php squirrelmail-1.4.3a-ja/src/printer_friendly_bottom.php
--- squirrelmail-1.4.3a/src/printer_friendly_bottom.php	2004-02-25 00:57:39.000000000 +0900
+++ squirrelmail-1.4.3a-ja/src/printer_friendly_bottom.php	2004-05-31 08:29:48.000000000 +0900
@@ -80,6 +80,8 @@
   $body = _("Message not printable");
 }
 
+if ($squirrelmail_language != 'ja_JP') { 
+
  /* now, if they choose to, we clean up the display a bit... */
  
 if ( empty($pf_cleandisplay) || $pf_cleandisplay != 'no' ) {
@@ -101,6 +103,7 @@
     $date = pf_clean_string($date, $num_leading_spaces);
 
 } // end cleanup
+}
 
 $to = decodeHeader($to);
 $cc = decodeHeader($cc);
diff -uNrw -x CVS squirrelmail-1.4.3a/src/read_body.php squirrelmail-1.4.3a-ja/src/read_body.php
--- squirrelmail-1.4.3a/src/read_body.php	2004-04-27 08:48:38.000000000 +0900
+++ squirrelmail-1.4.3a-ja/src/read_body.php	2004-05-31 08:29:48.000000000 +0900
@@ -169,6 +169,14 @@
 
     // FIX ME, use identity.php from SM 1.5. Change this also in compose.php
 
+    if (ereg("^([^@%/]+)[@%/](.+)$", $username, $usernamedata)) {
+       $popuser = $usernamedata[1];
+       $domain  = $usernamedata[2];
+       unset($usernamedata);
+    } else {
+       $popuser = $username;
+    }
+
     $reply_to = '';
     if (isset($identity) && $identity != 'default') {
         $from_mail = getPref($data_dir, $username, 
diff -uNrw -x CVS squirrelmail-1.4.3a/src/search.php squirrelmail-1.4.3a-ja/src/search.php
--- squirrelmail-1.4.3a/src/search.php	2004-03-07 06:02:50.000000000 +0900
+++ squirrelmail-1.4.3a-ja/src/search.php	2004-05-31 08:29:48.000000000 +0900
@@ -151,7 +151,7 @@
     $types = array('saved_what', 'saved_where', 'saved_folder');
     $attributes = get_saved($username, $data_dir);
     foreach ($types as $key) {
-        array_splice($attributes[$key], $delete_index, 1);
+        array_splice($attributes[$key], $delete_index - 1, 1);
     }
     reset($types);
     $n=0;
@@ -303,7 +303,7 @@
     . html_tag( 'tr' )
     . html_tag( 'td' )
     . html_tag( 'table', '', 'center', '', 'width="100%" cellpadding="2" cellspacing="2" border="0"' );
-    for ($i=0; $i < $saved_count; ++$i) {
+    for ($i=1; $i <= $saved_count; ++$i) {
         if ($i % 2) {
             echo html_tag( 'tr', '', '', $color[0] );
         } else {
