fixed the problem with us not being RFC complient for courier
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 18 Apr 2000 00:28:16 +0000 (00:28 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 18 Apr 2000 00:28:16 +0000 (00:28 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@434 7612ce4b-ef26-0410-bec9-ea0150e637f0

config/conf.pl
functions/imap_mailbox.php
functions/imap_messages.php
src/left_main.php

index 6e301d617e6551bd36f23c0d9be3bbc9a59fd98f..2a1fbf10d068ed8267ab360b826f22d2808c2f82 100755 (executable)
@@ -626,7 +626,7 @@ sub command211 {
    print "\n[folders] command (?=help) > ";
    $input = <STDIN>;
    $input =~ s/[\r|\n]//g;
    print "\n[folders] command (?=help) > ";
    $input = <STDIN>;
    $input =~ s/[\r|\n]//g;
-   while ($input !~ /d/i) {
+   while ($input !~ /^d$/i) {
       ## ADD
       if ($input =~ /^\s*\+\s*.*/) {
          $input =~ s/^\s*\+\s*//;
       ## ADD
       if ($input =~ /^\s*\+\s*.*/) {
          $input =~ s/^\s*\+\s*//;
index f9819a3347b75579ad249ce00ea9edf95666acb5..2b0ce28a2638ead881de2251a34749dd1b481276 100755 (executable)
@@ -92,6 +92,7 @@
     **  Formats a mailbox into 4 parts for the $boxes array
     ******************************************************************************/
    function sqimap_mailbox_parse ($line, $dm) {
     **  Formats a mailbox into 4 parts for the $boxes array
     ******************************************************************************/
    function sqimap_mailbox_parse ($line, $dm) {
+               global $folder_prefix;
       for ($g=0; $g < count($line); $g++) {
          $boxes[$g]["raw"] = $line[$g];
             
       for ($g=0; $g < count($line); $g++) {
          $boxes[$g]["raw"] = $line[$g];
             
          if (substr($mailbox, -1) == $dm)
             $dm_count--;
             
          if (substr($mailbox, -1) == $dm)
             $dm_count--;
             
-         for ($j = 0; $j < $dm_count; $j++)
+         for ($j = 0; $j < $dm_count - (countCharInString($folder_prefix, $dm)); $j++)
             $boxes[$g]["formatted"] = $boxes[$g]["formatted"] . "  ";
          $boxes[$g]["formatted"] .= readShortMailboxName($mailbox, $dm);
             
             $boxes[$g]["formatted"] = $boxes[$g]["formatted"] . "  ";
          $boxes[$g]["formatted"] .= readShortMailboxName($mailbox, $dm);
             
     **  The array returned looks like this:
     ******************************************************************************/
    function sqimap_mailbox_list ($imap_stream) {
     **  The array returned looks like this:
     ******************************************************************************/
    function sqimap_mailbox_list ($imap_stream) {
-      global $load_prefs_php, $prefs_php, $config_php, $data_dir, $username;
+      global $load_prefs_php, $prefs_php, $config_php, $data_dir, $username, $list_special_folders_first;
+               global $special_folders;
 
       $inbox_in_list = false;
       $inbox_subscribed = false;
 
       $inbox_in_list = false;
       $inbox_subscribed = false;
       /** LIST array **/
       fputs ($imap_stream, "a001 LIST \"\" \"$folder_prefix*\"\r\n");
       $list_ary = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
       /** LIST array **/
       fputs ($imap_stream, "a001 LIST \"\" \"$folder_prefix*\"\r\n");
       $list_ary = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
+
       for ($i=0;$i < count($list_ary); $i++) {
          $sorted_list_ary[$i]["name"] = find_mailbox_name($list_ary[$i]);
          $sorted_list_ary[$i]["raw"]  = $list_ary[$i];
       for ($i=0;$i < count($list_ary); $i++) {
          $sorted_list_ary[$i]["name"] = find_mailbox_name($list_ary[$i]);
          $sorted_list_ary[$i]["raw"]  = $list_ary[$i];
              }
       }
 
              }
       }
 
-      return sqimap_mailbox_parse ($merged, $dm);
-   }
-   
-/*
-      $original = $boxes;
-
-      for ($i = 0; $i < count($original); $i++) {
-         $boxes[$i]["unformatted"] = strtolower($boxes[$i]["unformatted"]);
-      }
-
-      $boxes = ary_sort($boxes, "unformatted", 1);
-
-      for ($i = 0; $i < count($boxes); $i++) {
-         for ($j = 0; $j < count($original); $j++) {
-            if ($boxes[$i]["id"] == $original[$j]["id"]) {
-               $boxes[$i] = $original[$j];
-            }
-         }
-      }     
-      
+               $boxes = sqimap_mailbox_parse ($merged, $dm);
+               
+               /** Now, lets sort for special folders **/
       for ($i = 0; $i < count($boxes); $i++) {
          if ($boxes[$i]["unformatted"] == $special_folders[0]) {
             $boxesnew[0] = $boxes[$i];
             $boxes[$i]["used"] = true;
          }
       }
       for ($i = 0; $i < count($boxes); $i++) {
          if ($boxes[$i]["unformatted"] == $special_folders[0]) {
             $boxesnew[0] = $boxes[$i];
             $boxes[$i]["used"] = true;
          }
       }
-      
+
       if ($list_special_folders_first == true) {
          for ($i = 0; $i < count($boxes); $i++) {
             for ($j = 1; $j < count($special_folders); $j++) {
       if ($list_special_folders_first == true) {
          for ($i = 0; $i < count($boxes); $i++) {
             for ($j = 1; $j < count($special_folders); $j++) {
-               if (substr($boxes[$i]["unformatted"], 0, strlen($special_folders[$j])) == $special_folders[$j]) {
+               if (substr($boxes[$i]["unformatted"], strlen($folder_prefix), strlen($special_folders[$j])) == $special_folders[$j]) {
                   $pos = count($boxesnew);
                   $boxesnew[$pos] = $boxes[$i];
                   $boxes[$i]["used"] = true;
                   $pos = count($boxesnew);
                   $boxesnew[$pos] = $boxes[$i];
                   $boxes[$i]["used"] = true;
             }
          }
       }
             }
          }
       }
-      
+               
       for ($i = 0; $i < count($boxes); $i++) {
          if (($boxes[$i]["unformatted"] != $special_folders[0]) &&
              ($boxes[$i]["used"] == false))  {
       for ($i = 0; $i < count($boxes); $i++) {
          if (($boxes[$i]["unformatted"] != $special_folders[0]) &&
              ($boxes[$i]["used"] == false))  {
 
       return $boxesnew;
    }
 
       return $boxesnew;
    }
-   */
    
    /******************************************************************************
     **  Returns a list of all folders, subscribed or not
    
    /******************************************************************************
     **  Returns a list of all folders, subscribed or not
index a7ac66e62873f28d981d5efa5baf3661655f7c05..f506bacaa3a96358e58328dc45316065b7657145 100755 (executable)
@@ -40,7 +40,7 @@
     **  Returns some general header information -- FROM, DATE, and SUBJECT
     ******************************************************************************/
    function sqimap_get_small_header ($imap_stream, $id, &$from, &$subject, &$date) {
     **  Returns some general header information -- FROM, DATE, and SUBJECT
     ******************************************************************************/
    function sqimap_get_small_header ($imap_stream, $id, &$from, &$subject, &$date) {
-      fputs ($imap_stream, "a001 FETCH $id:$id RFC822.HEADER.LINES (From Subject Date)\r\n");
+      fputs ($imap_stream, "a001 FETCH $id:$id BODY[HEADER.FIELDS (DATE FROM SUBJECT)]\r\n");
       $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
 
       $subject = _("(no subject)");
       $read = sqimap_read_data ($imap_stream, "a001", true, $response, $message);
 
       $subject = _("(no subject)");
index f1244e4e807bf5ac8c6881ce90e1e8dea9743598..8b7ce15d7dcfde16a5b74e56953773c7dff61eb0 100644 (file)
@@ -31,6 +31,7 @@
    echo "<HTML>";
 
    function formatMailboxName($imapConnection, $mailbox, $real_box, $delimeter, $color, $move_to_trash) {
    echo "<HTML>";
 
    function formatMailboxName($imapConnection, $mailbox, $real_box, $delimeter, $color, $move_to_trash) {
+               global $folder_prefix;
       require ("../config/config.php");
 
       $mailboxURL = urlencode($real_box);
       require ("../config/config.php");
 
       $mailboxURL = urlencode($real_box);
@@ -43,7 +44,7 @@
 
       $special_color = false;
       for ($i = 0; $i < count($special_folders); $i++) {
 
       $special_color = false;
       for ($i = 0; $i < count($special_folders); $i++) {
-         if (($special_folders[$i] == $real_box) && ($use_special_folder_color == true))
+         if ((substr($real_box, strlen($folder_prefix), strlen($special_folders[$i])) == $special_folders[$i]) && ($use_special_folder_color == true))
             $special_color = true;
       }
 
             $special_color = true;
       }