ソースを参照

ignore msg copy errors when messages are deleted. Most common error is related
to quota issues. Updated function tries to copy message to trash and then tags
it as deleted. If we can store message in trash, message is stored. If we can't,
trash folder is bypassed.

added version information to two configuration variables

tokul 19 年 前
コミット
4c334d0ae1
3 ファイル変更11 行追加9 行削除
  1. 2 0
      ChangeLog
  2. 3 2
      config/conf.pl
  3. 6 7
      functions/imap_messages.php

+ 2 - 0
ChangeLog

@@ -138,6 +138,8 @@ Version 1.5.2 - CVS
   - Added check_plugin_version() function.
   - If mailbox name starts with slash or contains ../, error message is
     generated. Safety check for insecure default UW IMAP setup (#1557078).
+  - Ignore message copy errors when messages are deleted. Allows to delete
+    messages when quota is exceeded. (#614887) (#646386) (#1446026)
 
 Version 1.5.1 (branched on 2006-02-12)
 --------------------------------------

+ 3 - 2
config/conf.pl

@@ -357,8 +357,6 @@ $noselect_fix_enable = 'false'          if ( !$noselect_fix_enable );
 $frame_top = "_top"                     if ( !$frame_top );
 $provider_uri = ''                      if ( !$provider_uri );
 $provider_name = ''                     if ( !$provider_name );
-$edit_identity = 'true'                 if ( !$edit_identity );
-$edit_name = 'true'                     if ( !$edit_name );
 $no_list_for_subscribe = 'false'        if ( !$no_list_for_subscribe );
 $allow_charset_search = 'true'          if ( !$allow_charset_search );
 $allow_advanced_search = 0              if ( !$allow_advanced_search) ;
@@ -371,6 +369,9 @@ $default_use_javascript_addr_book = 'false' if (! $default_use_javascript_addr_b
 
 # since 1.2.0
 $hide_sm_attributions = 'false'         if ( !$hide_sm_attributions );
+# since 1.2.5
+$edit_identity = 'true'                 if ( !$edit_identity );
+$edit_name = 'true'                     if ( !$edit_name );
 
 # since 1.4.0
 $use_smtp_tls= 'false'                  if ( !$use_smtp_tls);

+ 6 - 7
functions/imap_messages.php

@@ -69,16 +69,15 @@ function sqimap_msgs_list_delete($imap_stream, $mailbox, $id, $bypass_trash=fals
     // FIX ME, remove globals by introducing an associative array with properties
     // as 4th argument as replacement for the bypass_trash var
     global $move_to_trash, $trash_folder;
-    $bRes = true;
     if (($move_to_trash == true) && ($bypass_trash != true) &&
         (sqimap_mailbox_exists($imap_stream, $trash_folder) &&  ($mailbox != $trash_folder)) ) {
-        $bRes = sqimap_msgs_list_copy ($imap_stream, $id, $trash_folder);
-    }
-    if ($bRes) {
-        return sqimap_toggle_flag($imap_stream, $id, '\\Deleted', true, true);
-    } else {
-        return false;
+        /**
+         * turn off internal error handling (fourth argument = false) and
+         * ignore copy to trash errors (allows to delete messages when overquota)
+         */
+        sqimap_msgs_list_copy ($imap_stream, $id, $trash_folder, false);
     }
+    return sqimap_toggle_flag($imap_stream, $id, '\\Deleted', true, true);
 }