From 619526f64bedbebd1d91550f7e1cd531a034528b Mon Sep 17 00:00:00 2001 From: esantanche Date: Sat, 14 Nov 2015 17:11:19 +0000 Subject: [PATCH] Update EmailProcessor.php Changed the regex used to catch the return path and figure out which mailing the bounce is about. By doing this both '/Return-Path: ' and '/Return-Path:\s*' are found so that, if the space between 'Return-Path:' and the rest of the line is missing, the bounce is still processed. I used this fix to solve my bounces problem. --- CRM/Utils/Mail/EmailProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Utils/Mail/EmailProcessor.php b/CRM/Utils/Mail/EmailProcessor.php index e72ef02fd6..b07cd689f8 100644 --- a/CRM/Utils/Mail/EmailProcessor.php +++ b/CRM/Utils/Mail/EmailProcessor.php @@ -160,7 +160,7 @@ class CRM_Utils_Mail_EmailProcessor { $regex = '/^' . preg_quote($dao->localpart) . '(b|c|e|o|r|u)' . $twoDigitString . '([0-9a-f]{16})@' . preg_quote($dao->domain) . '$/'; // a tighter regex for finding bounce info in soft bounces’ mail bodies - $rpRegex = '/Return-Path: ' . preg_quote($dao->localpart) . '(b)' . $twoDigitString . '([0-9a-f]{16})@' . preg_quote($dao->domain) . '/'; + $rpRegex = '/Return-Path:\s*' . preg_quote($dao->localpart) . '(b)' . $twoDigitString . '([0-9a-f]{16})@' . preg_quote($dao->domain) . '/'; // a regex for finding bound info X-Header $rpXheaderRegex = '/X-CiviMail-Bounce: ' . preg_quote($dao->localpart) . '(b)' . $twoDigitString . '([0-9a-f]{16})@' . preg_quote($dao->domain) . '/i'; -- 2.25.1