From c8f920d60e685353aea2e4c2fc1cc387cca37c10 Mon Sep 17 00:00:00 2001 From: mark burdett Date: Fri, 11 Jan 2019 20:35:23 -0800 Subject: [PATCH] Rewrite any return-path headers found --- CRM/Mailing/Event/BAO/Reply.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/CRM/Mailing/Event/BAO/Reply.php b/CRM/Mailing/Event/BAO/Reply.php index 186792e53b..d7851563b8 100644 --- a/CRM/Mailing/Event/BAO/Reply.php +++ b/CRM/Mailing/Event/BAO/Reply.php @@ -154,6 +154,8 @@ class CRM_Mailing_Event_BAO_Reply extends CRM_Mailing_Event_DAO_Reply { $domainEmail = $domainValues['values'][0]['from_email']; $parsed->setHeader('Resent-From', $domainEmail); $parsed->setHeader('Resent-Date', date('r')); + // Rewrite any invalid Return-Path headers. + $parsed->setHeader('Return-Path', $fromEmail); // $h must be an array, so we can't use generateHeaders()'s result, // but we have to regenerate the headers because we changed To @@ -161,14 +163,6 @@ class CRM_Mailing_Event_BAO_Reply extends CRM_Mailing_Event_DAO_Reply { $h = $parsed->headers->getCaseSensitiveArray(); $b = $parsed->generateBody(); - // Rewrite any invalid Return-Path headers. - if (!empty($h['Return-Path'])) { - $h['Return-Path'] = $fromEmail; - } - if (!empty($h['Return-path'])) { - $h['Return-path'] = $fromEmail; - } - // FIXME: ugly hack - find the first MIME boundary in // the body and make the boundary in the header match it $ct = $h['Content-Type']; -- 2.25.1