Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-23389

ezcMailComposer bug when sending e-mails with long name and Norwegian characters

    Details

      Description

      The problem occurs when using Zeta Components' ezcMailComposer to send e-mails that contain a "To" field with a long name (used 80-100 characters) AND non-standard Norwegian characters such as "ÆØÅæøÅ". When that happens, you will get an email where the email headers are corrupted.

      Steps to reproduce:

      • Configure PHP to use a suitable e-mail technology. For testing purposes, sendmail was enough, had no need to configure SMTP;
      • Copy the attached "testmail.php" script to eZ Publish's root;
      • Run script from command line like this:

      php testmail.php <test@email.com>
      

      The e-mail is sent with corrupted headers. Please refer to the attached "zeta_components_response_headers_nor_characters.txt" file. You will notice that there are double linebreaks after the Date header, which causes the problem.

      1. testmail.php
        2 kB
        Nuno Oliveira
      2. zeta_components_response_headers_nor_characters.txt
        3 kB
        Nuno Oliveira
      3. zetacomponents_header_folder.patch
        1 kB
        Nuno Oliveira

        Issue Links

          Activity

          Hide
          Nuno Oliveira (Inactive) added a comment - - edited

          Notes:

          • In my tests, this only happens on the "To" field. Using long names + non-standard characters on "From" or "Subject" does not trigger the problem;
          • In my tests, the script returned:

          No recipient addresses found in header
          Email sent to <test@email.com>
          

          ...rather than sending an e-mail with corrupted headers. The "Email sent to <test@email.com>" part of the message is deceptive, as no e-mail is ever sent. This must be due to test environment differences (sendmail vs SMTP etc);

          • Customer provided a patch that resolves the issue for them. It did not resolve the issue on my tests, though. Still, it may be a good starting point for an official fix, which is why I included it as an attachment (zetacomponents_header_folder.patch)
          Show
          Nuno Oliveira (Inactive) added a comment - - edited Notes: In my tests, this only happens on the "To" field. Using long names + non-standard characters on "From" or "Subject" does not trigger the problem; In my tests, the script returned: No recipient addresses found in header Email sent to <test@email.com> ...rather than sending an e-mail with corrupted headers. The "Email sent to <test@email.com>" part of the message is deceptive, as no e-mail is ever sent. This must be due to test environment differences (sendmail vs SMTP etc); Customer provided a patch that resolves the issue for them. It did not resolve the issue on my tests, though. Still, it may be a good starting point for an official fix, which is why I included it as an attachment (zetacomponents_header_folder.patch)
          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          PR done on ZetaComponents repo: https://github.com/zetacomponents/Mail/pull/32

          Show
          Jérôme Vieilledent (Inactive) added a comment - PR done on ZetaComponents repo: https://github.com/zetacomponents/Mail/pull/32
          Show
          Jérôme Vieilledent (Inactive) added a comment - Fixed in zetacomponents/mail master: https://github.com/zetacomponents/Mail/commit/25d3483ececec9667c2351db669333e3ae1c6d89
          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          Currently no maintenance release has been tagged, but it's possible to workaround this and the patch via Composer. Todo so, ensure you have the following in your main composer.json (root of your project):

          "zetacomponents/mail": "dev-master#cff03ec as 1.8.1"
          

          This will make Composer consider dev-master#cff03ec as valid version 1.8.1.

          Note that this is temporary, until 1.8.1 is released for Zetacomponents/Mail.

          Show
          Jérôme Vieilledent (Inactive) added a comment - Currently no maintenance release has been tagged, but it's possible to workaround this and the patch via Composer. Todo so, ensure you have the following in your main composer.json (root of your project): "zetacomponents/mail": "dev-master#cff03ec as 1.8.1" This will make Composer consider dev-master#cff03ec as valid version 1.8.1 . Note that this is temporary, until 1.8.1 is released for Zetacomponents/Mail.
          Hide
          Pedro Resende (Inactive) added a comment -

          Apparently it's working using the following PR https://github.com/zetacomponents/Mail/pull/33

          Show
          Pedro Resende (Inactive) added a comment - Apparently it's working using the following PR https://github.com/zetacomponents/Mail/pull/33
          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          Here's the Symfony command I used to reproduce the issue.

          https://github.com/zetacomponents/Mail/pull/33 is not acceptable as we must respect the RFC.

          Show
          Jérôme Vieilledent (Inactive) added a comment - Here's the Symfony command I used to reproduce the issue. https://github.com/zetacomponents/Mail/pull/33 is not acceptable as we must respect the RFC.
          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          v1.8.1 has been tagged now.

          Show
          Jérôme Vieilledent (Inactive) added a comment - v1.8.1 has been tagged now.
          Hide
          Pedro Resende (Inactive) added a comment -

          Tested and approved by Q.A, except on Debian due to https://jira.ez.no/browse/EZP-23608

          Show
          Pedro Resende (Inactive) added a comment - Tested and approved by Q.A, except on Debian due to https://jira.ez.no/browse/EZP-23608

            People

            • Assignee:
              Unassigned
              Reporter:
              Nuno Oliveira (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: