This commit is contained in:
Ronald Q
2019-09-03 08:49:37 -04:00
parent b155ce1f9d
commit e2bac4b84e

View File

@@ -135,7 +135,20 @@ class ResponseReader
if (!empty($mail->textPlain)) { if (!empty($mail->textPlain)) {
preg_match("/{(.*)}/", $mail->textPlain, $matches); preg_match("/{(.*)}/", $mail->textPlain, $matches);
if ($matches) { if ($matches) {
$dataEmail = G::json_decode(Crypt::decryptString($matches[1]), true); try {
$dataEmail = G::json_decode(Crypt::decryptString($matches[1]), true);
} catch (Exception $e) {
Bootstrap::registerMonolog(
$this->channel,
300,
G::LoadTranslation('ID_ABE_RESPONSE_CANNOT_BE_IDENTIFIED'),
[],
config("system.workspace"),
'processmaker.log'
);
$mailbox->markMailAsRead($mailId);
continue;
}
$dataAbeReq = loadAbeRequest($dataEmail['ABE_REQ_UID']); $dataAbeReq = loadAbeRequest($dataEmail['ABE_REQ_UID']);
if (config("system.workspace") === $dataEmail['workspace'] if (config("system.workspace") === $dataEmail['workspace']
&& (array_key_exists('ABE_UID', $dataAbeReq) && $dataAbeReq['ABE_UID'] == $dataAbe['ABE_UID'])) { && (array_key_exists('ABE_UID', $dataAbeReq) && $dataAbeReq['ABE_UID'] == $dataAbe['ABE_UID'])) {
@@ -149,7 +162,6 @@ class ResponseReader
throw (new Exception(G::LoadTranslation('ID_CASE_DELEGATION_ALREADY_CLOSED'), 400)); throw (new Exception(G::LoadTranslation('ID_CASE_DELEGATION_ALREADY_CLOSED'), 400));
} }
$this->processABE($this->case, $mail, $dataAbe); $this->processABE($this->case, $mail, $dataAbe);
$mailbox->markMailAsRead($mailId);
Bootstrap::registerMonolog( Bootstrap::registerMonolog(
$this->channel, $this->channel,
100, // DEBUG 100, // DEBUG
@@ -174,6 +186,7 @@ class ResponseReader
'processmaker.log' 'processmaker.log'
); );
} }
$mailbox->markMailAsRead($mailId);
} }
} }
} }
@@ -347,7 +360,8 @@ class ResponseReader
true, true,
$caseInf['delIndex'], $caseInf['delIndex'],
$emailSetup, $emailSetup,
0 0,
WsBase::MESSAGE_TYPE_ACTIONS_BY_EMAIL
); );
return $result; return $result;
} }