The underlying problem is here: https://github.com/lucee/Lucee4/blob/master/lucee-java/lucee-core/src/lucee/runtime/net/smtp/StringDataSource.java#L37 https://github.com/lucee/Lucee4/blob/master/lucee-java/lucee-core/src/lucee/runtime/net/smtp/StringDataSource.java#L37
Any html and/or plain text content is converted into a StringDataSource, which in turn does one WordUtils.wrap on the text / html. Unfortunately, the org.apache.commons.lang.WordUtils::wrap function handles the incoming string as one line, regardless of any line break within the string.
A fix could be this: https://github.com/lucee/Lucee4/commit/ff5b291bf346fd36b23d30e29d6ab5c48c76e631 https://github.com/lucee/Lucee4/commit/ff5b291bf346fd36b23d30e29d6ab5c48c76e631
I have done a pull request on this change now (https://github.com/lucee/Lucee4/pull/27 https://github.com/lucee/Lucee4/pull/27).
Paul KlinkenbergOp 23 sep. 2015, om 16:23 heeft Julian Halliwell <@Julian_Halliwell> het volgende geschreven:
I’ve noticed that mail sent from Lucee (4.5.1.023) has line breaks inserted every 900 or so characters, despite the fact that the preceding block has multiple CRLFs and is therefore not a continuous line.
I’ve read this Railo ticket https://issues.jboss.org/browse/RAILO-2155 and understand that the Internet Message Format standard prescribes a limit of 998 characters per line after which mail servers are supposed to add a line. But that’s not the case here as all of my line lengths are well under that limit (I’m actually wrapping them at 72 before passing the text to cfmail)
The deliberate line breaks are all visible in the generated mail, but it seems they are being ignored and the first 998 characters treated as if it were a continuous line.
I’ve also tried belt & braces by using the “wraptext” attribute of cfmail, setting it at 72, with the same result: the wrapping is visible, but the unwanted break every 900 or so characters keeps being inserted. Specifying “quoted-printable” as a parameter makes no difference either.
I have tried using two different mail servers with the same result.
Running the same code against ACF using the same mail server does not result in any extra line breaks.
Here is a test case:
crlf=Chr( 13 ) & Chr( 10 );
lineEndingInABreak="one two three" & crlf;
textWithLineBreaks=RepeatString( lineEndingInABreak,140 );
For me, this generates mail with unwanted line breaks inserted at lines 66 and 132 in the first message. Can anyone confirm this behaviour and/or point to a workaround?
See Lucee at CFCamp Oct 22 & 23 2015 @ Munich Airport, Germany - Get your ticket NOW - http://www.cfcamp.org/ http://www.cfcamp.org/
You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to firstname.lastname@example.org mailto:email@example.com.
To post to this group, send email to firstname.lastname@example.org mailto:email@example.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/61cd997a-8f53-4795-aaea-b639e15a6879%40googlegroups.com https://groups.google.com/d/msgid/lucee/61cd997a-8f53-4795-aaea-b639e15a6879%40googlegroups.com?utm_medium=email&utm_source=footer.
For more options, visit https://groups.google.com/d/optout https://groups.google.com/d/optout.