1
0
mirror of https://github.com/freescout-helpdesk/freescout.git synced 2024-11-25 03:43:33 +01:00

Fix processing References header on fetching emails

This commit is contained in:
FreeScout 2018-11-17 23:07:17 -08:00
parent 8e359eda60
commit 70704c2bef

View File

@ -207,8 +207,15 @@ class FetchEmails extends Command
if (!is_array($references)) {
$references = array_filter(preg_split('/[, <>]/', $references));
}
// Maybe we need to check all references
$prev_message_id = $references[0];
// Find first non-empty reference
if (is_array($references)) {
foreach ($references as $reference) {
if (!empty(trim($reference))) {
$prev_message_id = trim($reference);
break;
}
}
}
}
// Some mail service providers change Message-ID of the outgoing email,