Review main Abandoned

8839[BUGFIX] Fix handling of parameterized headers in the SwiftMailerAdapter

Björn Steinbrink CR 0 V 0 Normal +81 −5 updated 06/03/13, 20:49

Commit message

SwiftMailer expects parameters to be set independent of the header value
itself. But currently the code doesn't actually split the raw header
value string, it just passes it on as the value. That means that
SwiftMailer won't see the embedded parameter as a parameter and things
break.

Review

  • Code review CR 0
  • Verified V 0

Files 2

Review log 21

  1. Steffen Gebert commented on patch set 1 04/13/13, 06:47

    (2 inline comments) Thanks for your patch! Could you add unit tests for this? This would also make it more clear, how to reproduce this bug.

    class.t3lib_mail_swiftmaileradapter.php:344

    Please add parameter name @param string $header ...

    class.t3lib_mail_swiftmaileradapter.php:345

    @retun

    class.t3lib_mail_swiftmaileradapter.php:347

    I think it would be nice, if there would be a comment that explains how the input of this function looks like and what the result is. Some checks about e.g. what happens, when there's no ; (and throw an exception otherwise) would make it more robust. I'm sorry that I can't contribute too much myself, as I'm not so deep into that topic!
  2. Steffen Gebert commented on patch set 2 1 comment 04/13/13, 06:47

    I would prefer that you didn't submit this
  3. Steffen Gebert uploaded patch set 2 04/13/13, 06:47

  4. Björn Steinbrink commented on patch set 2 04/13/13, 06:47

    (1 inline comment) Next version will have tests, they're somewhat ugly though, as the adapter class combines conversion and the actual mail sending, so I had to dig more holes into the class. Additionally, the type-switch for the headers is combined with that code that handles the individual types, so the tests rely on the header name which is an implementation detail. But I don't think I want to refactor the adapter class, so...

    class.t3lib_mail_swiftmaileradapter.php:59 Reply

    getHeaders() returns an object, these are always passed by reference.

    class.t3lib_mail_swiftmaileradapter.php:59 Reply

    I replied in the previous version, but gerrit seems to have omitted mentioning my replies in the list at the bottom *sigh* getHeaders() returns an object, which is passed by reference.

    class.t3lib_mail_swiftmaileradapter.php:347 Reply

    OK. Parameters are optional though, so throwing an exception would be a bug. The current code already does the right thing, i.e. simply returning an empty array when there are no parameters.

    class.t3lib_mail_swiftmaileradapter.php:372 Reply

    Not trailing whitespace, just the EOL marker.
  5. Björn Steinbrink uploaded patch set 3 04/13/13, 06:47

  6. Stefan Neufeind commented on patch set 4 04/13/13, 06:47

    (3 inline comments) Can reading the headers really be moved?
  7. Philipp Gampe commented on patch set 4 04/13/13, 06:47

    Looks good to me, but someone else must approve
  8. Björn Steinbrink uploaded patch set 4 04/13/13, 06:47

  9. Stefan Neufeind commented on patch set 5 04/13/13, 06:47

    (1 inline comment)
  10. Stefan Neufeind commented on patch set 5 04/13/13, 06:47

    Looks good to me, but someone else must approve
  11. Jigal van Hemert commented on patch set 5 3 comments 04/13/13, 06:47

    I would prefer that you didn't submit this The SwiftMailerAdapter was not meant to handle all kinds of mails (it also can't handle nested subparts). The idea was to provide a mechanism which could handle most cases until extensions started using the new mail API. If you really want to support parameterized headers then they should be handled as RFC 2231 describes, including charsets, encoding, continuation.
  12. Philipp Gampe commented on patch set 5 04/13/13, 06:47

    Looks good to me, but someone else must approve
  13. Philipp Gampe commented on patch set 5 V 0 04/13/13, 06:47

    Checked with unit tests, somebody should send some mails too.
  14. Björn Steinbrink uploaded patch set 5 04/13/13, 06:47

  15. Björn Steinbrink commented on patch set 5 04/13/13, 06:47

    (1 inline comment)
  16. Mr. Jenkins commented on patch set 1 04/13/13, 06:47

  17. Mr. Jenkins commented on patch set 2 04/13/13, 06:47

  18. Mr. Jenkins commented on patch set 3 04/13/13, 06:47

  19. Mr. Jenkins commented on patch set 4 04/13/13, 06:47

  20. Mr. Jenkins commented on patch set 5 04/13/13, 06:47

  21. Jigal van Hemert commented on patch set 5 04/13/13, 06:47

    Abandoned The SwiftMailerAdapter will be deprecated in TYPO3 CMS 6.1. It was only meant as a temporary solution to send *most* mails from old API calls using SwiftMailer until the extensions use the new mail API. The extension should by now use the new mail API. No effort will be made to improve the SwiftMailerAdapter or to add functionality.