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

Logging on bounce detection

This commit is contained in:
FreeScout 2019-01-04 03:40:34 -08:00
parent b77e268441
commit f96a78cb82

View File

@ -279,11 +279,12 @@ class FetchEmails extends Command
$original_from = $this->formatEmailList($message->getFrom());
$original_from = $original_from[0];
$is_bounce = preg_match('/^mailer\-daemon@/i', $original_from);
$this->line('['.date('Y-m-d H:i:s').'] Bounce detected by From header: '.$original_from);
}
}
// Check Return-Path header
if (!$is_bounce && preg_match("/^Return\-Path: <>/i", $headers)) {
$this->line('['.date('Y-m-d H:i:s').'] bounce detected from return-path');
$this->line('['.date('Y-m-d H:i:s').'] Bounce detected by Return-Path header.');
$is_bounce = true;
}