Sent dumbfolders and special folders fixed for Cyrus. (Philippe Mingo
authorthomppj <thomppj@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 18 Jan 2002 14:40:28 +0000 (14:40 +0000)
committerthomppj <thomppj@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 18 Jan 2002 14:40:28 +0000 (14:40 +0000)
on Bunzo's Box)

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2161 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_mailbox.php
plugins/sent_subfolders/setup.php

index 6581262..13922bd 100755 (executable)
@@ -19,16 +19,19 @@ function isSpecialMailbox( $box ) {
 
     global $trash_folder, $sent_folder, $draft_folder,
            $move_to_trash, $move_to_sent, $save_as_draft,
-           $delimiter, $folder_prefix;
+           $delimiter, $folder_prefix, $imap_server_type;
 
     if ( $move_to_sent  ) {
-        $i = strpos( $sent_folder, $delimiter, strlen( $folder_prefix ) );
-        if ( $i === FALSE ) {
+        if ( $imap_server_type == 'uw' ) {
+            $i = strpos( $sent_folder, $delimiter, strlen( $folder_prefix ) );
+            if ( $i === FALSE ) {
+                $i = strlen( $box );
+            }
+        } else {
             $i = strlen( $box );
         }
-        
     }
-    
+
     $ret = ( (strtolower($box) == 'inbox') ||
              ($box == $trash_folder &&
               $move_to_trash) ||
index 49ba12d..a2565c6 100644 (file)
@@ -160,16 +160,22 @@ function sent_subfolders_update_sentfolder() {
             Multiple year holders with messages in it. level 1.
             Multiple year folders with holders in it. level 2.
         */
+
+        if( $imap_server_type == 'uw' ) {
+            $cnd_delimiter = '';
+        } else {
+            $cnd_delimiter = $delimiter;
+        }
+                                        
         switch ($sent_subfolders_setting) {
         case SMPREF_SENT_SUBFOLDERS_YEARLY:
             $level = 1;
-            $sent_subfolder = $sent_subfolders_base
+            $sent_subfolder = $sent_subfolders_base . $cnd_delimiter
                             . $year;
-            $year_folder = $sent_subfolder;
             break;
         case SMPREF_SENT_SUBFOLDERS_QUARTERLY:
             $level = 2;
-            $sent_subfolder = $sent_subfolders_base
+            $sent_subfolder = $sent_subfolders_base . $cnd_delimiter 
                             . $year
                             . $delimiter . $quarter;
             $year_folder = $sent_subfolders_base
@@ -177,7 +183,7 @@ function sent_subfolders_update_sentfolder() {
             break;
         case SMPREF_SENT_SUBFOLDERS_MONTHLY:
             $level = 2;
-            $sent_subfolder = $sent_subfolders_base
+            $sent_subfolder = $sent_subfolders_base . $cnd_delimiter
                             . $year
                             . $delimiter . $month;
             $year_folder = $sent_subfolders_base . $year;
@@ -189,11 +195,6 @@ function sent_subfolders_update_sentfolder() {
             $year_folder = $sent_folder;
         }
 
-        if( $sent_subfolders_setting <> SMPREF_SENT_SUBFOLDERS_DISABLED && 
-            $imap_server_type <> 'uw' ) {
-            $year_folder .= $delimiter;            
-        }
-
         /* If this folder is NOT the current sent folder, update stuff. */
         if ($sent_subfolder != $sent_folder) {
             /* First, update the sent folder. */