Bug #90320

Swift_RfcComplianceException for invalid email in MailMessage->setTo()

Added by Stephan GroƟberndt 21 days ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-02-04
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

There is a bug in the swiftmailer implementation in TYPO3 9.5 and 8.7:

GeneralUtility::makeInstance(MailMessage::class)
->setFrom('foo@bar.org')
->setTo('foo@ba r.org')
->setSubject('subject)
->setBody('body')
->send();

throws a Swift_RfcComplianceException

Address in mailbox given [foo@ba r.org] does not comply with RFC 2822, 3.6.2.

Swift_RfcComplianceException thrown in file
/typo3_src-8.7.30/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php in line 345.

In method MailMessage::send() a Swift_RfcComplianceException would be caught by Mailer::send() and add it to the list of $failedRecipients but MailMessage::setTo() does not.

TYPO3 v10 no longer contains the swiftmailer implementation.

Also available in: Atom PDF