Uploaded image for project: 'Lucee Development'
  1. LDEV-545

CFMAIL adds unwanted line breaks in mail body

    Details

    • Type: Bug
    • Status: Deployed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.5.1.023
    • Fix Version/s: 5.0.1.54
    • Labels:

      Description

      Mail sent from Lucee has line breaks inserted every 900 or so characters, despite the fact that the preceding text contains multiple CRLFs and is therefore not a continuous line.

      Test case:

      <cfscript>
      crlf=Chr( 13 ) & Chr( 10 );
      lineEndingInABreak="one two three" & crlf;
      textWithLineBreaks=RepeatString( lineEndingInABreak,140 );
      </cfscript>
      <!--- 1. Mail with no additional attributes--->
      <cfmail from="from@localhost" to="to@localhost" subject="Just line breaks"><cfoutput>#textWithLineBreaks#</cfoutput></cfmail>
      <!--- 2. Wrap text at 72--->
      <cfmail from="from@localhost" to="to@localhost" subject="Line breaks plus wrap text at 72" wraptext="72"><cfoutput>#textWithLineBreaks#</cfoutput></cfmail>
      

      The cause seems to be the use of WordUtils.wrap handling the incoming string as a single line. See Paul Klinkenberg's explanation here...

      https://groups.google.com/forum/#!topic/lucee/iHp0aI83dGw

      ...and his Pull Request with a suggested fix here:

      https://github.com/lucee/Lucee4/pull/27

        Attachments

          Activity

            People

            • Assignee:
              21solutions Igal Sapir
              Reporter:
              julianhalliwell Julian Halliwell
            • Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: