exception, custom mail folder

This commit is contained in:
Alex Lushpai 2016-03-15 12:59:19 +03:00
parent 1fd90324ca
commit 6f958c739b
3 changed files with 18 additions and 2 deletions

View File

@ -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

View File

@ -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');

View File

@ -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;
} }
} }
} }