CoreCommunity ExtensionsIncubatorDistributionsTYPO3 4.5 ProjectsTYPO3 4.6 ProjectsTYPO3 4.7 ProjectsTYPO3 6.0 ProjectsTYPO3 6.1 ProjectsTYPO3 6.2 Projects (+)

Bug #38153

Comma-separated list of To-Emails breaks TYPO3Mailer

Added by Stefan Rotsch 11 months ago. Updated 9 months ago.

Status:Resolved Start date:2012-06-18
Priority:Should have Due date:
Assignee:Reinhard Führicht % Done:

100%

Category:Finisher
Target version:v1.4
Votes: 1 (View)

Description

With Mailer_TYPO3Mailer, I get an error message when trying to send Emails to a comma-separated list of recipients:

Address in mailbox given [xxx@yyy.zz,aaa@bbb.cc] does not comply with RFC 2822, 3.6.2.

Referring to the PHPdoc comment of the send() method in class Tx_Formhandler_Mailer_TYPO3Mailer, multiple recipients have to be passed as an array. But Tx_Formhandler_Finisher_Mail calls this method with the argument "implode(',', $recipients)", so there is always a string passed. Exploding this string again in Tx_Formhandler_Mailer_TYPO3Mailer makes it work for me.

I also stumbled upon a condition in Tx_Formhandler_Finisher_Mail which always evaluates to false because the comparison string is not defined. It also might be a comma-separated list instead of an array.

Please see the attached patch for a fix working for me.

Btw., the TS property to_name does not seem to be fully implemented as only the value of to_email gets passed to the send() method... but I did no fruther investigation here as it might require a much more complex patch.

20120618_formhandler.patch (1.3 kB) Stefan Rotsch, 2012-06-18 15:40

38153.patch (3.7 kB) Reinhard Führicht, 2012-07-16 14:34

Associated revisions

Revision 64837
Added by Reinhard Führicht 10 months ago

Changes in MailerInterface and both mailers to fix a bug when using multiple recipients (fixes #38153)

Revision 64837
Added by Reinhard Führicht 10 months ago

Changes in MailerInterface and both mailers to fix a bug when using multiple recipients (fixes #38153)

History

Updated by Reinhard Führicht 11 months ago

  • Category set to Finisher
  • Status changed from New to Accepted
  • Assignee set to Reinhard Führicht
  • Target version set to v1.4

You are right, the code doesn't seem right there.

I tend to changing the interface to only allow an array to be passed to the "send" method each entry containing email and name pairs.
This should work pretty well for the TYPO3Mailer, but would need some adjustments for HtmlMail.

I will investigate this further.

Updated by Reinhard Führicht 10 months ago

  • File 38153.patch added
  • Status changed from Accepted to Needs Feedback

Please see attached patch. It changes the mailer interface to accept arrays only (not a strict check though).
Mailer_HtmlMail is changed accordingly.

Furthermore, I added a check if the count of recipients is bigger than zero before calling the mailer.

Updated by Reinhard Führicht 10 months ago

  • Status changed from Needs Feedback to Resolved
  • % Done changed from 0 to 100

Applied in changeset r64837.

Also available in: Atom PDF