FIX: swiftmailer: correctly set errors-to header (#31826)

This commit is contained in:
Marc de Lima Lucio 2024-11-15 14:10:35 +01:00 committed by GitHub
parent 4feb9def4e
commit ce9a1b3661
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -577,7 +577,7 @@ class CMailFile
if (!empty($this->errors_to)) {
try {
$headers->addTextHeader('Errors-To', $this->getArrayAddress($this->errors_to));
$headers->addTextHeader('Errors-To', $this->getValidAddress($this->errors_to, 0));
} catch (Exception $e) {
$this->errors[] = $e->getMessage();
}
@ -644,7 +644,6 @@ class CMailFile
$this->errors[] = $e->getMessage();
}
}
//if (!empty($this->errors_to)) $this->message->setErrorsTo($this->getArrayAddress($this->errors_to));
if (isset($this->deliveryreceipt) && $this->deliveryreceipt == 1) {
try {
$this->message->setReadReceiptTo($this->getArrayAddress($this->addr_from));