check mailbox before creation
This commit is contained in:
parent
a35c4bc06d
commit
ebe2c6390a
|
@ -870,11 +870,15 @@ class imapAccess extends baseModule {
|
||||||
$imapConnection = 0;//default state is false
|
$imapConnection = 0;//default state is false
|
||||||
if ($imap_admin_password) {
|
if ($imap_admin_password) {
|
||||||
$imapConnection = @imap_open("{" . $imap_server_address . "}", $imap_admin_user, $imap_admin_password, OP_HALFOPEN, 1);
|
$imapConnection = @imap_open("{" . $imap_server_address . "}", $imap_admin_user, $imap_admin_password, OP_HALFOPEN, 1);
|
||||||
$createErrors = $this->createMailbox($imapConnection, $uid, $email_domain);
|
$prefix = $this->getMailboxPrefix();
|
||||||
$errors = array_merge($errors, $createErrors);
|
$list = imap_list($imapConnection, "{" . $imap_server_address . "}", $prefix . $this->getSep() . $uid);
|
||||||
if (empty($createErrors)) {
|
if (empty($list)) {
|
||||||
$quotaErrors = $this->setQuota($imapConnection, $uid, $email_domain, $limit);
|
$createErrors = $this->createMailbox($imapConnection, $uid, $email_domain);
|
||||||
$errors = array_merge($errors, $quotaErrors);
|
$errors = array_merge($errors, $createErrors);
|
||||||
|
if (empty($createErrors)) {
|
||||||
|
$quotaErrors = $this->setQuota($imapConnection, $uid, $email_domain, $limit);
|
||||||
|
$errors = array_merge($errors, $quotaErrors);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($imapConnection) {
|
if ($imapConnection) {
|
||||||
|
|
Loading…
Reference in New Issue