note 70289 added to function.imap-deletemailbox
| From: | saninatksetdotorg at osu1 dot php dot net | Date: | Tue, 10 Oct 2006 15:27:08 +0000 |
| Subject: | note 70289 added to function.imap-deletemailbox | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-118350@lists.php.net to get a copy of this message | ||
When deleting user account(s) from IMAP server don't forget to put full server name and port.
Also need to be logged as IMAP admin and set ACL.
This worked for Cyrus:
<?php
//Credentials
$cyrusadmin_username="cyrus";
$cyrusadmin_password="cyruspassword";
$cyrus_serverip="fellowship.ring.net";
//User to delete
$username="frodoBaggins";
//Open the connection to IMAP server (Cyrus)
$mbox=imap_open("{".$serverip.":143}",$cyrusadmin_username,
$cyrusadmin_password, OP_HALFOPEN)
or die('IMAP Could not connect because '.imap_last_error());
//Set ACL - Give rights to $cyrusadmin_username to delete mailbox
imap_setacl ($mbox, "user.".$username, $cyrusadmin_username, "lrswipcda")
or die('Could not setacl on mailbox');
//Delete mailbox
imap_deletemailbox($mbox,"{".$serverip.":143}user.".$username)
or die('Could not delete mailbox');
?>
----
Server IP: 66.163.161.117
Probable Submitter: 89.172.14.29
----
Manual Page -- http://www.php.net/manual/en/function.imap-deletemailbox.php
Edit -- https://master.php.net/note/edit/70289
Del: integrated -- https://master.php.net/note/delete/70289/integrated
Del: useless -- https://master.php.net/note/delete/70289/useless
Del: bad code -- https://master.php.net/note/delete/70289/bad+code
Del: spam -- https://master.php.net/note/delete/70289/spam
Del: non-english -- https://master.php.net/note/delete/70289/non-english
Del: in docs -- https://master.php.net/note/delete/70289/in+docs
Del: other reasons-- https://master.php.net/note/delete/70289
Reject -- https://master.php.net/note/reject/70289
Search -- https://master.php.net/manage/user-notes.php