- Removed function references from address book database backend class,
list_addr(), lookup() and search() functions. Referenced lookup()
function caused E_NOTICE warnings in php 4.4.0. Reported by Cor Bosman.
+ - Test to ensure folder exists before attempting to delete it, otherwise
+ IMAP server will return an error.
Version 1.5.0 - 2 February 2004
-------------------------------
function sqimap_mailbox_delete ($imap_stream, $mailbox) {
global $data_dir, $username;
sqimap_unsubscribe ($imap_stream, $mailbox);
- $read_ary = sqimap_run_command($imap_stream, 'DELETE ' .
- sqimap_encode_mailbox_name($mailbox),
- true, $response, $message);
- if ($response !== 'OK') {
- // subscribe again
- sqimap_subscribe ($imap_stream, $mailbox);
- } else {
- do_hook_function('rename_or_delete_folder', $args = array($mailbox, 'delete', ''));
- removePref($data_dir, $username, "thread_$mailbox");
- removePref($data_dir, $username, "collapse_folder_$mailbox");
+
+ if (sqimap_mailbox_exists($imap_stream, $mailbox)) {
+
+ $read_ary = sqimap_run_command($imap_stream, 'DELETE ' .
+ sqimap_encode_mailbox_name($mailbox),
+ true, $response, $message);
+ if ($response !== 'OK') {
+ // subscribe again
+ sqimap_subscribe ($imap_stream, $mailbox);
+ } else {
+ do_hook_function('rename_or_delete_folder', $args = array($mailbox, 'delete', ''));
+ removePref($data_dir, $username, "thread_$mailbox");
+ removePref($data_dir, $username, "collapse_folder_$mailbox");
+ }
}
}
}
}
-?>
\ No newline at end of file
+?>