Skip to content
Snippets Groups Projects
Commit 5d045eab authored by Peter Rotich's avatar Peter Rotich
Browse files

Add routing to check if a message is a bounced reply

parent 78650a7a
No related branches found
No related tags found
No related merge requests found
......@@ -866,6 +866,7 @@ class TicketFilter {
$bounce_headers = array(
'From' => array('<MAILER-DAEMON@MAILER-DAEMON>', 'MAILER-DAEMON', '<>'),
'Subject' => array('DELIVERY FAILURE', 'DELIVERY STATUS', 'UNDELIVERABLE:'),
'Return-Path' => '<>',
);
foreach ($bounce_headers as $header => $find) {
......
......@@ -377,7 +377,25 @@ Class ThreadEntry {
}
function isAutoResponse() {
return $this->getEmailHeader()?TicketFilter::isAutoResponse($this->getEmailHeader()):false;
static $autoresp;
if (!isset($autoresp))
$autoresp = $this->getEmailHeader() ? TicketFilter::isAutoResponse($this->getEmailHeader()) : false;
return $autoresp;
}
function isAutoBounce() {
static $autobounce;
if (!isset($autobounce))
$autobounce = $this->getEmailHeader() ? TicketFilter::isAutoBounce($this->getEmailHeader()) : false;
return $autobounce;
}
function isAutoReply() {
return ($this->isAutoResponse() || $this->isAutoBounce());
}
//Web uploads - caller is expected to format, validate and set any errors.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment