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

Blank e-mail subject line with multi-byte characters (iconv_mime_encode: Unknown error)

    Details

      Description

      In some conditions, notifications (such as sub-tree modification alerts) for content with multi-byte characters will have a blank subject line; this only (AFAIK) applies if the message is sent through the SMTP Transport class in eZ Components (which is the case if eZ Publish is configured to send messages through an SMTP server).

      After configuring MailSettings to use an SMTP server, the following script reproduces the issue:

      #!/usr/bin/env php
      <?php
       
      require 'autoload.php';
       
      $cli = eZCLI::instance();
       
      $script = eZScript::instance(
          array(
              'description' => "",
              'use-session' => false,
              'use-modules' => true,
              'use-extensions' => true
          )
      );
      $script->startup();
      $script->initialize();
       
      $mail = new eZMail();
       
      $mail->setSender('SENDER E-MAIL ADDRESS GOES HERE');
      $mail->setReceiver('RECEIVER E-MAIL ADDRESS GOES HERE');
       
      ///////////////
      $mail->setSubject('This is a test');
      $mail->setBody("1 test mail");
      eZMailTransport::send($mail);
      ///////////////
      $mail->setSubject('Folder "ログイン前トップ" は更新されました [cms.mipotecq.biz - フォト&amp;ムービー]');
      $mail->setBody("2 full subject");
      eZMailTransport::send($mail);
      ///////////////
      $mail->setSubject('Folder "ログイン前トップ" は更新されました');
      $mail->setBody("3 half left");
      eZMailTransport::send($mail);
      ///////////////
      $mail->setSubject(' [cms.mipotecq.biz - フォト&amp;ムービー]');
      $mail->setBody("4 half right");
      eZMailTransport::send($mail);
      ///////////////
      $mail->setSubject(' は更新されました [cms.mipotecq.biz');
      $mail->setBody("5 center");
      eZMailTransport::send($mail);
       
      ///////////////
      $mail->setSubject('"ログイン前トップ"');
      $mail->setBody("6 content");
      eZMailTransport::send($mail);
      ///////////////
      $mail->setSubject(' は更新されました');
      $mail->setBody("7 content type");
      eZMailTransport::send($mail);
      ///////////////
      $mail->setSubject('Folder "ログイン前トップ"');
      $mail->setBody("8 left");
      eZMailTransport::send($mail);
      ///////////////
      $mail->setSubject('Folder "ログイ');
      $mail->setBody("9 Folder");
      eZMailTransport::send($mail);
       
      $script->shutdown();
      

      Example notice displayed during script execution (repeats a few times, for each affected message):

      PHP Notice:  iconv_mime_encode(): Unknown error (7) in /var/www/ezp/500-ezp/ezpublish_legacy/lib/ezc/Mail/src/interfaces/part.php on line 381
      PHP Stack trace:
      PHP   1. {main}() /var/www/ezp/500-ezp/ezpublish_legacy/script.php:0
      PHP   2. eZMailTransport::send() /var/www/ezp/500-ezp/ezpublish_legacy/script.php:66
      PHP   3. eZSMTPTransport->sendMail() /var/www/ezp/500-ezp/ezpublish_legacy/lib/ezutils/classes/ezmailtransport.php:56
      PHP   4. ezcMailSmtpTransport->send() /var/www/ezp/500-ezp/ezpublish_legacy/lib/ezutils/classes/ezsmtptransport.php:86
      PHP   5. ezcMailPart->generate() /var/www/ezp/500-ezp/ezpublish_legacy/lib/ezc/Mail/src/transports/smtp/smtp_transport.php:490
      PHP   6. ezpMail->generateHeaders() /var/www/ezp/500-ezp/ezpublish_legacy/lib/ezc/Mail/src/interfaces/part.php:434
      PHP   7. ezcMail->generateHeaders() /var/www/ezp/500-ezp/ezpublish_legacy/kernel/private/classes/ezpmail.php:31
      PHP   8. ezcMailPart->generateHeaders() /var/www/ezp/500-ezp/ezpublish_legacy/lib/ezc/Mail/src/mail.php:381
      PHP   9. iconv_mime_encode() /var/www/ezp/500-ezp/ezpublish_legacy/lib/ezc/Mail/src/interfaces/part.php:381
      

      9 messages will be sent, some of them missing a subject line. This issue does not appear to be present when using sendmail.

        Issue Links

          Activity

          Filipe Dobreira (Inactive) created issue -
          Filipe Dobreira (Inactive) made changes -
          Field Original Value New Value
          Summary iconv_mime_encode: Unknown error - Blank e-mail subject line with multi-byte characters Blank e-mail subject line with multi-byte characters (iconv_mime_encode: Unknown error)
          Filipe Dobreira (Inactive) made changes -
          Status Open [ 1 ] Confirmed [ 10037 ]
          Gunnstein Lye made changes -
          Status Confirmed [ 10037 ] InputQ [ 10001 ]
          Gunnstein Lye made changes -
          Rank Ranked higher
          Paulo Bras (Inactive) made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Assignee Paulo Bras [ paulo.bras@ez.no ]
          Jérôme Vieilledent (Inactive) made changes -
          Link This issue relates to EZP-19032 [ EZP-19032 ]
          Jérôme Vieilledent (Inactive) made changes -
          Assignee Paulo Bras [ paulo.bras@ez.no ] Jérôme Vieilledent [ jerome.vieilledent@ez.no ]
          Jérôme Vieilledent (Inactive) made changes -
          Remote Link This issue links to "https://github.com/zetacomponents/Mail/pull/8 (Web Link)" [ 12519 ]
          Jérôme Vieilledent (Inactive) made changes -
          Status Development [ 3 ] Development review [ 10006 ]
          Jérôme Vieilledent (Inactive) made changes -
          Remote Link This issue links to "https://github.com/zetacomponents/Mail/pull/8 (Web Link)" [ 12705 ]
          Jérôme Vieilledent (Inactive) made changes -
          Status Development review [ 10006 ] Development Review done [ 10028 ]
          Affects Version/s 5.1 [ 11280 ]
          Affects Version/s 5.2-beta1 [ 12684 ]
          Fix Version/s 5.2-rc1 [ 12781 ]
          Jérôme Vieilledent (Inactive) made changes -
          Status Development Review done [ 10028 ] Documentation done [ 10011 ]
          Joao Pingo (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Assignee Jérôme Vieilledent [ jerome.vieilledent@ez.no ] Joao Pingo [ joao.pingo@ez.no ]
          Jérôme Vieilledent (Inactive) made changes -
          Fix Version/s 5.0 Maintenance [ 11287 ]
          Fix Version/s 5.1 Maintenance [ 12301 ]
          Joao Pingo (Inactive) made changes -
          Remaining Estimate 0 minutes [ 0 ]
          Time Spent 3 hours [ 10800 ]
          Worklog Id 40643 [ 40643 ]
          Joao Pingo (Inactive) made changes -
          Worklog Id 40643 [ 40643 ]
          Joao Pingo (Inactive) made changes -
          Status QA [ 10008 ] InputQ [ 10001 ]
          Assignee Joao Pingo [ joao.pingo@ez.no ]
          Joao Pingo (Inactive) made changes -
          Status InputQ [ 10001 ] Documentation [ 10010 ]
          Assignee Joao Pingo [ joao.pingo@ez.no ]
          Joao Pingo (Inactive) made changes -
          Status Documentation [ 10010 ] Documentation done [ 10011 ]
          Joao Pingo (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Joao Pingo (Inactive) made changes -
          Rank Ranked higher
          Joao Pingo (Inactive) made changes -
          Status QA [ 10008 ] InputQ [ 10001 ]
          Assignee Joao Pingo [ joao.pingo@ez.no ]
          Joao Pingo (Inactive) made changes -
          Time Spent 3 hours [ 10800 ] 4 hours [ 14400 ]
          Worklog Id 40775 [ 40775 ]
          Jérôme Vieilledent (Inactive) made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Assignee Jérôme Vieilledent [ jerome.vieilledent@ez.no ]
          Jérôme Vieilledent (Inactive) made changes -
          Status Development [ 3 ] Documentation done [ 10011 ]
          Filipe Dobreira (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Assignee Jérôme Vieilledent [ jerome.vieilledent@ez.no ] Filipe Dobreira [ filipe.dobreira@ez.no ]
          Filipe Dobreira (Inactive) made changes -
          Assignee Filipe Dobreira [ filipe.dobreira@ez.no ]
          Status QA [ 10008 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          André Rømcke made changes -
          Workflow eZ Engineering Scrumban Workflow [ 58965 ] EZ* Development Workflow [ 84240 ]
          Alex Schuster made changes -
          Workflow EZ* Development Workflow [ 84240 ] EZEE Development Workflow [ 122885 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Filipe Dobreira (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h