Review main Merged

17505[BUGFIX] Sending fails on multiple email-addresses

Stefan Neufeind CR +2 V +2 Normal +155 −4 updated 06/03/13, 20:49

Commit message

Specifying multiple recipients (To or CC) for emails
leads to an error upon form-submit without further explanation.
This patch implements validation for multiple email addresses of
which only the valid ones are then returned.
The sending-API can already handle multiple recipients.

Review

  • Code review CR +2
    • Jigal van Hemert +2
    • Christian Kuhn +1
  • Verified V +2
    • Jigal van Hemert +2
    • Stefan Neufeind +1
    • Christian Kuhn +1

Files 2

Review log 39

Show 14 earlier messages
  1. Stefan Neufeind commented on patch set 1 03/31/13, 16:46

    (2 inline comments)

    MailPostProcessor.php:150

    Do we need to explicitly allow "NULL" here? Intention was to allow calling the function with a variable from the typoScript-array no matter if it is set or not and simply check in this function here.

    MailPostProcessor.php:190

    I don't want to hide that API-call was changed from AddCc to setCc. The swift-mailer-API used here has addCc (lowercase a) but that doesn't take an array as argument. So this can't be submitted as a separate change - or we would need to submit that change first. But I also think that in case you explicitly specify CC via typoScript you want to *set* that instead of *adding* it. (I assume that the swiftmailer-message will have an empty CC anyhow - but calling set makes it a bit clearer and consistent imho.)
  2. Stefan Neufeind commented on patch set 1 03/31/13, 16:46

    Please note that in case this one is accepted, I'll add a documentation-fix to explicitly mention that multiple addresses can be comma-separated.
  3. Stefan Neufeind commented on patch set 1 03/31/13, 16:46

    (2 inline comments)
  4. Stefan Neufeind uploaded patch set 2 03/31/13, 16:46

  5. Stefan Neufeind uploaded patch set 3 03/31/13, 16:46

  6. Stefan Neufeind commented on patch set 3 03/31/13, 16:46

    (1 inline comment) somebody please have a look
  7. Stefan Neufeind uploaded patch set 4 03/31/13, 16:46

  8. Stefan Neufeind commented on patch set 4 03/31/13, 16:46

    just applied changes as Markus suggested. Please reapply votes.
  9. Markus Klein commented on patch set 1 03/31/13, 16:46

    I would prefer that you didn't submit this
    WHAT fails on multiple...?

    MailPostProcessor.php:148

    email addresses

    MailPostProcessor.php:150 Reply

    AFAIK using an unset index of the TS-array would give a NULL here but more a "", hence I'd opt for removing the NULL here.

    MailPostProcessor.php:151

    email addresses

    MailPostProcessor.php:155

    Invert condition and return immediately. Should be a simple guard.

    MailPostProcessor.php:156

    Attention: Namespaces!! --> GeneralUtlity

    MailPostProcessor.php:158

    same here

    MailPostProcessor.php:178

    Remove "> 0"

    MailPostProcessor.php:190 Reply

    +1

    MailPostProcessor.php:192

    Remove "> 0"
  10. Markus Klein commented on patch set 3 03/31/13, 16:46

    Looks good to me, but someone else must approve
  11. Markus Klein commented on patch set 3 03/31/13, 16:46

    (4 inline comments)
  12. Dmitry Dulepov commented on patch set 5 03/31/13, 16:46

    Looks good to me, but someone else must approve
  13. Stefan Neufeind commented on patch set 5 03/31/13, 16:46

    ping
  14. Stefan Neufeind uploaded patch set 6 03/31/13, 16:46

  1. Stefan Neufeind commented on patch set 6 03/31/13, 16:46

    Changed parsing of addresses. Thanks Jigal for the hint.
  2. Stefan Neufeind uploaded patch set 7 03/31/13, 16:46

  3. Stefan Neufeind commented on patch set 7 03/31/13, 16:46

    just added a very basic test
  4. Stefan Neufeind commented on patch set 7 03/31/13, 16:46

    (2 inline comments)
  5. Markus Klein commented on patch set 5 03/31/13, 16:46

    Looks good to me, but someone else must approve
  6. Markus Klein uploaded patch set 5 03/31/13, 16:46

  7. Markus Klein commented on patch set 6 03/31/13, 16:46

    Looks good to me, but someone else must approve Very nice improvement!
  8. Markus Klein commented on patch set 7 03/31/13, 16:46

    (1 inline comment)
  9. Oliver Klee commented on patch set 6 03/31/13, 16:46

    Can we have some unit tests for this?
  10. Christian Kuhn uploaded patch set 8 03/31/13, 16:46

  11. Stefan Neufeind commented on patch set 9 V 0 03/31/13, 16:46

    Tests from Christian run fine. Thanks a bunch.
  12. Christian Kuhn commented on patch set 9 03/31/13, 16:46

    Verified; Looks good to me, but someone else must approve
  13. Christian Kuhn uploaded patch set 9 03/31/13, 16:46

  14. Jigal van Hemert commented on patch set 5 03/31/13, 16:46

    I would prefer that you didn't submit this

    MailPostProcessor.php:161

    Splitting on ',' doesn't really work with all valid formats for lists of mail addresses. See TYPO3\CMS\Core\Mail\SwiftMailerAdapter::parseAddresses() for proper parsing.
  15. Jigal van Hemert commented on patch set 6 03/31/13, 16:46

    Verified; Looks good to me, but someone else must approve The validEmail() check isn't necessary after the address parser has filtered the recipients because it only produces RFC822 compliant addresses. The extra processing is only done when sending a mail form, so it doesn't have much impact.
  16. Mr. Jenkins commented on patch set 1 03/31/13, 16:46

  17. Mr. Jenkins commented on patch set 2 03/31/13, 16:46

  18. Mr. Jenkins commented on patch set 3 03/31/13, 16:46

  19. Mr. Jenkins commented on patch set 4 03/31/13, 16:46

  20. Mr. Jenkins commented on patch set 5 03/31/13, 16:46

  21. Mr. Jenkins commented on patch set 6 03/31/13, 16:46

  22. Mr. Jenkins commented on patch set 7 03/31/13, 16:46

  23. Mr. Jenkins commented on patch set 9 03/31/13, 16:46

  24. Jigal van Hemert commented on patch set 9 V 0 03/31/13, 16:46

    by team member; Looks good to me, approved
  25. Jigal van Hemert merged patch set 10 03/31/13, 16:46