#94350Impossible to add Return-path to email in TYPO3 v. 10
Description
The code below tries to add a bounce account as return path, but $senderEmail is used ad Return-Path in final mail header… – worked like a charm in TYPO3 v. 9
$subject = 'Test mail';
$bounceEmail = 'bounce@typoconsult.dk';
$senderName = 'TypoConsult';
$senderEmail = 'info@typoconsult.dk';
$fromAddress = new Address($senderEmail, $senderName);
$mail = GeneralUtility::makeInstance(MailMessage::class);
$mail->to(new Address('ch@typoconsult.dk'));
$mail->subject($subject);
$mail->returnPath(new Address($bounceEmail));
$mail->from($fromAddress);
$mail->replyTo($fromAddress);
$mail->sender($fromAddress);
$mail->html('This is a <b>test</b> mail...');
$mail->send();
Mail configuration is: /usr/sbin/sendmail -t -i
See attached image
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Files 1
History 7
-
Oliver Bartsch commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2021-10-13T12:20:27+00:00" > 10/13/21, 12:20 </span>Hi, is this issue still relevant?
-
Alex Kellner commented <span data-processor="relativetime" data-value="2022-06-06T17:21:37+00:00" > 06/06/22, 17:21 </span>
It’s still used in powermail. If there is a breaking change, we would have to adopt it – see https://github.com/einpraegsam/powermail/issues/668
-
Juergen Waelther commented <span data-processor="relativetime" data-value="2022-09-22T16:00:29+00:00" > 09/22/22, 16:00 </span>
There is an solution in newer Symfony Mime/Mailer versions, see https://github.com/symfony/symfony/issues/41322.
Should this updated in the Typo3 core packages? -
Michal Cygankiewicz commented <span data-processor="relativetime" data-value="2023-02-11T09:54:15+00:00" > 02/11/23, 09:54 </span>
I have same issue – is there any known solution that can be applied to TYPO3 10?
-
Juergen Waelther commented <span data-processor="relativetime" data-value="2023-02-23T10:14:18+00:00" > 02/23/23, 10:14 </span>
@cygankiewicz , as a workaround change order in component symfony/mailer file DelayedEnvelope.php as described here and it works:
https://github.com/symfony/symfony/issues/41322#issuecomment-1049776517 -
Riccardo De Contardi commented and changed status
Needs FeedbackClosed <span data-processor="relativetime" data-value="2026-07-10T14:12:14+00:00" > 07/10/26, 14:12 </span>I apologize for the very late answer.
As far as I can tell TYPO3 v.14 uses
"symfony/mailer": "^7.4.12"; therefore I guess this issue can be closed as no more relevant.If you think that this is the wrong decision or experience the issue again on recent TYPO3 versions like 13 or 14, please open a new issue with a step-by-step guide about how to reproduce it and a reference to this one.
Thank you and sorry again for the so late answer.
Claus Harup wrote:
> The code below tries to add a bounce account as return path, but $senderEmail is used ad Return-Path in final mail header… – worked like a charm in TYPO3 v. 9
>
> […]
>
> Mail configuration is: /usr/sbin/sendmail -t -i
>
> See attached image
UPDATE: https://stackoverflow.com/questions/26762802/phpmailer-bounced-mails-not-getting-bounced-right/26765956#26765956
Don’t use ReturnPath – set Sender instead. Support for the ReturnPath property was recently disabled in PHPMailer (in version 5.2.8) because it’s invalid to set it at the point of sending. The return path is added by the receiver when it receives the message, and is set by putting your desired return path into the Sender property, which gets passed as the envelope sender during the SMTP conversation. Sender is set automatically when you call setFrom, but you can override it and just set it directly