Merged in bugfix/PMC-347 (pull request #6741)

PMC-347

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Ronald Quenta
2019-01-21 13:57:10 +00:00
committed by Julio Cesar Laura Avendaño

View File

@@ -126,15 +126,14 @@ class ResponseReader
);
// Read all messages into an array
$mailsIds = $mailbox->searchMailbox('ALL');
$mailsIds = $mailbox->searchMailbox('UNSEEN');
if ($mailsIds) {
$mailsInfo = $mailbox->getMailsInfo($mailsIds);
// Get the first message and save its attachment(s) to disk:
foreach ($mailsIds as $key => $mailsId) {
/** @var IncomingMail $mail */
$mail = $mailbox->getMail($mailsId);
preg_match("/{(.*)}/", $mail->textPlain, $matches);
if ($matches && $mailsInfo[$key]->seen === 0) {
if ($matches) {
$dataEmail = G::json_decode(Crypt::decryptString($matches[1]), true);
if (config("system.workspace") === $dataEmail['workspace']) {
$this->case = $dataEmail;