From c987f934b146ce63bbf157619c19be0f9cd591f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 13 May 2023 08:58:52 +0200 Subject: [PATCH 1/2] add returnpath for swiftmailer --- htdocs/core/class/CMailFile.class.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index 418ef0612ba..f87bafb513d 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -6,7 +6,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2019-2022 Frédéric France + * Copyright (C) 2019-2023 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -512,7 +512,7 @@ class CMailFile // Give the message a subject try { - $result = $this->message->setSubject($this->subject); + $this->message->setSubject($this->subject); } catch (Exception $e) { $this->errors[] = $e->getMessage(); } @@ -557,6 +557,14 @@ class CMailFile } } + if (!empty($this->errors_to)) { + try { + $this->message->setReturnPath($this->getArrayAddress($this->errors_to)); + } catch (Exception $e) { + $this->errors[] = $e->getMessage(); + } + } + try { $this->message->setCharSet($conf->file->character_set_client); } catch (Exception $e) { From 6caa8549bc043195200250fbe96b66d6c0368500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 16 May 2023 09:33:12 +0200 Subject: [PATCH 2/2] fix errors-to with swiftmailer --- htdocs/core/class/CMailFile.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php index f87bafb513d..5c65230517f 100644 --- a/htdocs/core/class/CMailFile.class.php +++ b/htdocs/core/class/CMailFile.class.php @@ -559,7 +559,7 @@ class CMailFile if (!empty($this->errors_to)) { try { - $this->message->setReturnPath($this->getArrayAddress($this->errors_to)); + $headers->addTextHeader('Errors-To', $this->getArrayAddress($this->errors_to)); } catch (Exception $e) { $this->errors[] = $e->getMessage(); }