mirror of
https://github.com/retailcrm/legacy.git
synced 2025-02-21 09:13:16 +03:00
exception, custom mail folder
This commit is contained in:
parent
1fd90324ca
commit
6f958c739b
@ -18,7 +18,7 @@ driver=mysql
|
|||||||
enabled=false
|
enabled=false
|
||||||
|
|
||||||
[mail]
|
[mail]
|
||||||
mail@example.com=login,password,imap.example.com,993,imap
|
mail@example.com=login,password,imap.example.com,993,imap,SpecialFolderName
|
||||||
mail@example.org=login,password,pop.example.org,995,pop
|
mail@example.org=login,password,pop.example.org,995,pop
|
||||||
enabled=false
|
enabled=false
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ class Mail
|
|||||||
$this->mailBox = $mailBox;
|
$this->mailBox = $mailBox;
|
||||||
|
|
||||||
if (is_array($this->container->mail)) {
|
if (is_array($this->container->mail)) {
|
||||||
if(isset($this->container->mail[$mailBox])) {
|
if (isset($this->container->mail[$mailBox])) {
|
||||||
$this->mailSettings = explode(
|
$this->mailSettings = explode(
|
||||||
',',
|
',',
|
||||||
$this->container->mail[$mailBox]
|
$this->container->mail[$mailBox]
|
||||||
@ -32,6 +32,7 @@ class Mail
|
|||||||
|
|
||||||
public function parse()
|
public function parse()
|
||||||
{
|
{
|
||||||
|
|
||||||
$server = new Server(
|
$server = new Server(
|
||||||
$this->mailSettings[2],
|
$this->mailSettings[2],
|
||||||
$this->mailSettings[3],
|
$this->mailSettings[3],
|
||||||
@ -43,6 +44,10 @@ class Mail
|
|||||||
$this->mailSettings[1]
|
$this->mailSettings[1]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!empty($this->mailSettings[5])) {
|
||||||
|
$server->setMailBox($this->mailSettings[5]);
|
||||||
|
}
|
||||||
|
|
||||||
$mailCriteria = $this->clean($this->mailBox, 'criteria');
|
$mailCriteria = $this->clean($this->mailBox, 'criteria');
|
||||||
$mailHandler = $this->clean($this->mailBox, 'handler');
|
$mailHandler = $this->clean($this->mailBox, 'handler');
|
||||||
|
|
||||||
|
@ -46,11 +46,22 @@ class RequestProxy
|
|||||||
"[$method] " . $e->getMessage() . "\n",
|
"[$method] " . $e->getMessage() . "\n",
|
||||||
$this->container->errorLog
|
$this->container->errorLog
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return null;
|
||||||
} catch (InvalidJsonException $e) {
|
} catch (InvalidJsonException $e) {
|
||||||
$this->logger->write(
|
$this->logger->write(
|
||||||
"[$method] " . $e->getMessage() . "\n",
|
"[$method] " . $e->getMessage() . "\n",
|
||||||
$this->container->errorLog
|
$this->container->errorLog
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
} catch (InvalidArgumentException $e) {
|
||||||
|
$this->logger->write(
|
||||||
|
"[$method] " . $e->getMessage() . "\n",
|
||||||
|
$this->container->errorLog
|
||||||
|
);
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user