From 7b1f03c9fe4c5f4ae5dca2a2620a2ec9752b8167 Mon Sep 17 00:00:00 2001 From: kink Date: Sun, 6 Feb 2005 22:04:10 +0000 Subject: [PATCH] Add workaround for Mercury/32 servers that will subscribe again to 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 | 2 ++ src/left_main.php | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 71444d6f..6e28c087 100644 --- 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 -------------------- diff --git a/src/left_main.php b/src/left_main.php index 027fa990..38e622e7 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -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); + } } } } -- 2.25.1