PHP can create, but not delete
| From: | Greg | Date: | Tue, 11 Feb 2003 16:07:24 +0000 |
| Subject: | PHP can create, but not delete | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-135198@lists.php.net to get a copy of this message | ||
Hi-
I'm having a problem with deleting a Cyrus IMAP mailbox. I can create the
mailbox just fine. Any ideas on why I can't delete the mailbox? Here is
some code that I got off this newgroup a few months ago:
function deleteMailbox ($mailbox) {
$existing_boxes = imap_listmailbox($this->stream, "{" .
$this->imap["host$
if ( empty($existing_boxes) ) {
$this->Error = "deleteMailbox(): mailbox does not exist.";
return(false);
}
# Now we add the delete ACL to cyrus feature...
if ( ! imap_setacl($this->stream, imap_utf7_encode($mailbox),
$this->imap$
$this->Error = imap_last_error();
return(false);
}
if ( imap_deletemailbox($this->stream, imap_utf7_encode("{" .
$this->imap$
return(true);
} else {
$this->Error = imap_last_error();
return(false);
}
}