CRLF not recognised in Lucee 5.2.3.35

I might be missing something here but AFAIK #chr(13)&chr(10)# or #chr(13)##chr(10)# should give a new line in tags such as cfset.

Seems fine on Lucee 4.5.1.023 but in Lucee 5.2.3.35 no cr or line feed…

Any thoughts?

Hi Tony. Seems to be working ok here. A lot of stuff would break if it wasn’t. How are you testing it? Try browsing a .cfm containing just this:

<cfoutput><pre>line1#chr(13)&chr(10)#line2</pre></cfoutput>

This gives me the following as expected:

line1
line2

Hi Julian

Yes, the code you gave me works as expected…

This is the code that I’ve inherited - It works in 4.5…

<cfset BodyText = “#CHR(13)##CHR(10)##maxi# item lines requested:#CHR(13)##CHR(10)# #CHR(13)##CHR(10)#”>
<cfmail to="#request.Email#" from="#request.EmailAddress1#"
subject="#SubjectString#"
type=“text”>#HdrText##ToAddrText##FromAddrText##BodyText#</cfmail>

The CRLF’s are totally ignored in lucee 5 and using your way of doing CRLF
also fails! Its actually in the email output where it fails - there are no
CRLF’s!

Thank you for your help

Tony

I still can’t replicate it, Tony. I’ve tried your code (populating the variables with dummy values) and this slightly simpler test:

<cfset crlf = Chr( 13 ) & Chr( 10 )>
<cfset body = "Line1#crlf#Line2#crlf#Line3">
<cfmail server="localhost" from="from@test.com" to="to@test.com" subject="test" type="text">#body#</cfmail>

The output in the email is as expected:

Line1
Line2
Line3

Hi…

Interesting - running your code produces no CRLF - output is Line1 Line2 Line3 in the email…

I’m using debian 9 + lucee on Google Cloud Platform and SendGrid as the email provider

Could the whitespace control have any effect here?

CommandBox on Windows here with the latest Java 8 and whitespace management off. But turning it on makes no difference.

To isolate this within Lucee, try running my test, but using a non-existent mail server so that sending fails. The generated mail should be saved into the equivalent of ACF’s “spool” folder, which is WEB-INF/remote-client/open. Open the “.tsk” file with a text editor and search for “Line1”. Have the CRLFs been added or not? This is what I’m seeing:

...localhostpppt  t Line1
Line2
Line3sq ~ =w UTF-8...etc

You can see that the line breaks are there.

It would appear that there are line breaks - output is the same as yours…

now, why would sendgrid remove them? Do you think this is the right direction?

just a quick question, what OS are you running these tests on?

Debian 9 Stretch…

Found the problem - SendGrid automatically turns plain text into HTML emails - It’s not apparent from the output/look of the email.

Turn on Plain Content on SendGrid and the email remains as plain text…

Thanks Julian!

1 Like