Uploaded image for project: 'Zeta Components'
  1. Zeta Components
  2. ZETACOMP-114

Using ezcMailAddress with specific charset can break final Mail headers

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Mail
    • None
    • PHP 5.3 / 5.4

    Description

      When using ezcMailAddress with a charset other than us-ascii (let's say "utf-8") for a sender with a name having accents (also valid for cc, bcc and receiver), ezcMailTools::composeEmailAddress() does the encoding via iconv_mime_encode(). This operation eventually adds a line break (\r\n) if generated name is too long (exceeding 76 chars).
      Problem is that this operation is done a 2nd time in ezcMailPart::generateHeaders(), potentially introducing a new line break. This completely messes up the mail headers and can end with something like that :

      From: =?utf-8?Q?mailTest=C3=A4=C3=B6=C3=BC=20mail?==?utf-8?Q?Test?=
      
       =?utf-8?Q?=C3=A4=C3=B6=C3=BC?= <jv@ez.no>
      To: Test mail <jv+test@ez.no>
      Subject: =?utf-8?Q?This=20is=20a=20test=20H=C3=A9h?==?utf-8?Q?=C3=A9=C3=B6?=
       =?utf-8?Q?=C3=AF=C3=BB$=C3=B9=20@=C3=A8=C3=AA=C3=AB=C3=B8?=
      MIME-Version: 1.0
      User-Agent: eZ Components
      Date: Tue, 03 Jan 2012 14:56:21 +0100
      Message-Id: <201201031414321.21215.0@ez.no>
      Content-Type: text/plain; charset=utf-8
      Content-Transfer-Encoding: 8bit
      

      Here the From header is completely broken.
      The original sender name is "mailTestäöüß mailTestäöüß"

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            lolautruche Jérôme Vieilledent

            Dates

              Created:
              Updated:

              Slack

                Issue deployment