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

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Confirmed Confirmed
          1m 32s 1 Filipe Dobreira (Inactive) 16/Sep/13 11:58 AM
          Confirmed Confirmed InputQ InputQ
          3h 3m 1 Gunnstein Lye 16/Sep/13 3:01 PM
          Development Development Development Review Development Review
          6d 1h 42m 1 jerome.vieilledent@ez.no 23/Sep/13 3:40 PM
          Development Review Development Review Development Review done Development Review done
          6d 19h 50m 1 jerome.vieilledent@ez.no 30/Sep/13 11:30 AM
          Development Review done Development Review done Documentation Review done Documentation Review done
          12m 35s 1 jerome.vieilledent@ez.no 30/Sep/13 11:43 AM
          InputQ InputQ Documentation Documentation
          43s 1 Joao Pingo (Inactive) 03/Oct/13 12:34 PM
          Documentation Documentation Documentation Review done Documentation Review done
          2m 59s 1 Joao Pingo (Inactive) 03/Oct/13 12:37 PM
          QA QA InputQ InputQ
          3d 55m 2 Joao Pingo (Inactive) 03/Oct/13 1:45 PM
          InputQ InputQ Development Development
          5d 18h 41m 2 jerome.vieilledent@ez.no 08/Oct/13 9:31 AM
          Development Development Documentation Review done Documentation Review done
          11s 1 jerome.vieilledent@ez.no 08/Oct/13 9:31 AM
          Documentation Review done Documentation Review done QA QA
          2h 3m 3 Filipe Dobreira (Inactive) 08/Oct/13 10:32 AM
          QA QA Closed Closed
          1d 3h 1 Filipe Dobreira (Inactive) 09/Oct/13 1:33 PM

            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