mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-11 06:28:40 +00:00
Trying to fix presumably imap connection errors
This commit is contained in:
parent
dc09cbb703
commit
064d5f2e85
|
|
@ -91,7 +91,7 @@ class Imap implements MailBoxInterface
|
||||||
$this->password = $pass;
|
$this->password = $pass;
|
||||||
$this->port = $port;
|
$this->port = $port;
|
||||||
$this->encryption = $encryption;
|
$this->encryption = $encryption;
|
||||||
$this->flags .= $this->encryption !== EncryptionType::NONE ? '/ssl' : '';
|
$this->flags .= $this->encryption !== EncryptionType::NONE ? '/ssl' : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -127,7 +127,11 @@ class Imap implements MailBoxInterface
|
||||||
*/
|
*/
|
||||||
public function getBoxes() : array
|
public function getBoxes() : array
|
||||||
{
|
{
|
||||||
$list = \imap_list($this->mailbox, $reference = '{' . $this->host . ':' . $this->port . '}', '*');
|
$list = \imap_list(
|
||||||
|
$this->mailbox,
|
||||||
|
$reference = '{' . $this->host . ':' . $this->port . '}',
|
||||||
|
'*'
|
||||||
|
);
|
||||||
if (!\is_array($list)) {
|
if (!\is_array($list)) {
|
||||||
return []; // @codeCoverageIgnore
|
return []; // @codeCoverageIgnore
|
||||||
}
|
}
|
||||||
|
|
@ -292,7 +296,12 @@ class Imap implements MailBoxInterface
|
||||||
*/
|
*/
|
||||||
public function moveMail(string | array $messages, string $box) : bool
|
public function moveMail(string | array $messages, string $box) : bool
|
||||||
{
|
{
|
||||||
return \imap_mail_copy($this->mailbox, !\is_string($messages) ? \implode(',', $messages) : $messages, '{' . $this->host . ':' . $this->port . '}' . $box);
|
return \imap_mail_copy(
|
||||||
|
$this->mailbox,
|
||||||
|
!\is_string($messages)
|
||||||
|
? \implode(',', $messages)
|
||||||
|
: $messages, '{' . $this->host . ':' . $this->port . '}' . $box
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -306,7 +315,7 @@ class Imap implements MailBoxInterface
|
||||||
*/
|
*/
|
||||||
public function deleteMail(int $msg) : bool
|
public function deleteMail(int $msg) : bool
|
||||||
{
|
{
|
||||||
return \imap_delete($this->mailbox, $msg);
|
return \imap_delete($this->mailbox, (string) $msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ class Pop3 implements MailBoxInterface
|
||||||
*/
|
*/
|
||||||
public function connectInbox() : bool
|
public function connectInbox() : bool
|
||||||
{
|
{
|
||||||
$this->mailbox = ($tmp = \imap_open(
|
$this->mailbox = ($tmp = @\imap_open(
|
||||||
'{' . $this->host . ':' . $this->port . $this->flags . '}',
|
'{' . $this->host . ':' . $this->port . $this->flags . '}',
|
||||||
$this->username, $this->password
|
$this->username, $this->password
|
||||||
)) === false ? null : $tmp;
|
)) === false ? null : $tmp;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user