Mark Crispin wrote:

Don't use "filesize = 0" as the test. Use "stream->nmsgs = 0" (from a
c-client stream open on the mailbox) instead.


I do that, and pases that test. But then the actuly delete of the mailbox fail, but not if it hase no pseudo message, dont realy know why, but they not always ther. Here is the code, I open the imap chanel whitout user/server data to go strajt to the filesystem thru client. Works great - for everything else anyway :-/

$mbox = imap_open($mailbox, "", "");

$n = imap_num_msg($mbox);

if(!$n) {
       if(imap_deletemailbox($mbox, $mailbox)) {
                   print("$mailbox KILLED!\n\n");
       } else {
                   print("ERROR: $mailbox not killed\n\n");
       }
} else {
       print("$mailbox NOT killed, not empty!\n\n");
}
imap_close($mbox);

Sorry, this is PHP interface to c-client - might not look to familiar :-/

/LaH




Reply via email to