mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 09:48: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->port = $port;
|
||||
$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
|
||||
{
|
||||
$list = \imap_list($this->mailbox, $reference = '{' . $this->host . ':' . $this->port . '}', '*');
|
||||
$list = \imap_list(
|
||||
$this->mailbox,
|
||||
$reference = '{' . $this->host . ':' . $this->port . '}',
|
||||
'*'
|
||||
);
|
||||
if (!\is_array($list)) {
|
||||
return []; // @codeCoverageIgnore
|
||||
}
|
||||
|
|
@ -292,7 +296,12 @@ class Imap implements MailBoxInterface
|
|||
*/
|
||||
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
|
||||
{
|
||||
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
|
||||
{
|
||||
$this->mailbox = ($tmp = \imap_open(
|
||||
$this->mailbox = ($tmp = @\imap_open(
|
||||
'{' . $this->host . ':' . $this->port . $this->flags . '}',
|
||||
$this->username, $this->password
|
||||
)) === false ? null : $tmp;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user