Project

General

Profile

Actions

Bug #94350

open

Impossible to add Return-path to email in TYPO3 v. 10

Added by Claus Harup over 3 years ago. Updated over 1 year ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2021-06-15
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

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


Files

sreen.png (42.5 KB) sreen.png Claus Harup, 2021-06-15 15:22
Actions #1

Updated by Claus Harup over 3 years ago

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

Actions #2

Updated by Oliver Bartsch about 3 years ago

  • Status changed from New to Needs Feedback

Hi, is this issue still relevant?

Actions #3

Updated by Alex Kellner over 2 years ago

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

Actions #4

Updated by Juergen Waelther about 2 years ago

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?

Actions #5

Updated by Michal Cygankiewicz almost 2 years ago

I have same issue - is there any known solution that can be applied to TYPO3 10?

Actions #6

Updated by Juergen Waelther over 1 year ago

@Michal 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

Actions

Also available in: Atom PDF