Add workaround for Mercury/32 servers that will subscribe again to
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 6 Feb 2005 22:04:10 +0000 (22:04 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 6 Feb 2005 22:04:10 +0000 (22:04 +0000)
an already subscribed folder (#1115409).

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

ChangeLog
src/left_main.php

index 71444d6..6e28c08 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -207,6 +207,8 @@ Version 1.5.1 -- CVS
   - Fixed sorting problem is get_squirrel_sort() function (#1115403).
   - Add "Show Only Subscribed Folders" option to allow users to show all
     folders instead of only subscribed ones (#1105756, #1105250).
+  - Add workaround for Mercury/32 servers that will subscribe again to
+    an already subscribed folder (#1115409).
 
 Version 1.5.0
 --------------------
index 027fa99..38e622e 100644 (file)
@@ -890,10 +890,14 @@ if ($auto_create_special && !isset($auto_create_done)) {
             if ( !sqimap_mailbox_exists($imapConnection, $folder)) {
                 sqimap_mailbox_create($imapConnection, $folder, '');
             } else {
-                //if (!sqimap_mailbox_is_subscribed($imapConnection, $folder)) {
-                // check for subscription is useless and expensive  just
-                // surpress the NO response
-                sqimap_subscribe($imapConnection, $folder, false);
+                // check for subscription is useless and expensive, just
+                // surpress the NO response. Unless we're on Mecury, which
+                // will just subscribe a folder again if it's already
+                // subscribed.
+                if ( strtolower($imap_server_type) != 'mercury32' ||
+                    !sqimap_mailbox_is_subscribed($imapConnection, $folder) ) {
+                    sqimap_subscribe($imapConnection, $folder, false);
+                }
             }
         }
     }