G'Day all... I have a strange issue with cfmail a...
# lucee
b
G'Day all... I have a strange issue with cfmail and email attachments... If the name of an email attachment contains enough diacritical characters then when the email is delivered the attachment filename will be corrupted. For example 'ThêQuickBrownFoxJúmpsOverTheDog.docx' is fine but 'ThêQuickBrøwnFoxJúmpsOverTheDog.docx' results in a file name resembling '=UTF-8QTh=C3=AAQuickBr=C3=B8wnFoxJ=C3=BAmpsOverTheDog.docx='. I'm guessing this is an issue with the length of the filename and handling of utf-8 characters because even a relatively short name like 'ThêQúickƁrøwñƑøx.docx' is corrupted into '=UTF-8QTh=C3=AAQ=C3=BAick=C6=81r=C3=B8w=C3=B1=C6=91=C3=B8x.docx='. The same files sent via Gmail to the same recipient are delivered with the filenames as you would expect. I'm thinking this is a Lucee bug but thought I would check here in case someone has seen this before (I couldn't find it in the backlog). Tested on 5.3.10.79-RC and 5.3.9.141 - and yes, I have the charset attribute set to 'utf-8'
b
So? It isn't a Lucee issue?
z
dunno!
ThêQuickBrownFoxJúmpsOverTheDog.docx
ThêQuickBrøwnFoxJúmpsOverTheDog.docx
so the
ø
is triggering a different encoding?
b
I don't think so - the result '=UTF-8QTh=C3=AAQuickBr=C3=B8wnFoxJ=C3=BAmpsOverTheDog.docx=' suggests all the diacritic characters have been encoded. And if I replace the 'o' and change the 'u' to 'ú' instead the name is still corrupted.
'ThêQuickBrøwnFoxJumpsOverTheDog.docx' does not get corrupted but 'ThêQuickBrøwnFøxJumpsOverTheDog.docx' does.
Similarly 'ThêQuickBrownêFoxêJumpsOverTheDog.docx' is corrupted but 'ThêQuickBrownêFoxJumpsOverTheDog.docx' is not
z
the encoding is triggered by any character value gt 127 in the
StringUtil.isAscii
check
ø is 157
b
fair enough - so it must be the length of the encoded string that is causing the issue?
z
let's debug this a bit, what dos the content look like from the mail listeners? https://docs.lucee.org/guides/cookbooks/mail_listeners.html
b
let me set those up - I was playing with them earlier but our mail send logic is built around handing the errors directly so sending 'async' is not possible without a lot of refactoring and regression testing - but I can plug a listener into my test code, no problem...
Not a lot to see - esp regarding attachments...
z
time to file a ticket i reckon
b
ok... thanks for digging into the issue! Do you want me to quote any of the above in the ticket - or is it better/easier for you to raise the ticket?
z
have a go 🙂
👍 1
as we finally have CI services for smtp, i think @pothys-mitrahsoft will be able to knock up a test case for this
b
Should I post this on https://dev.lucee.org/ first?
z
nah, that banner in jira is from me, we have triaged this enough to file a ticket
b
ok
p
sure, I will create a testcase for this along with the ticket
b
Cool, thanks @pothys-mitrahsoft
👍 1
d
Does this mean my quoted-printable patch might finally get some traction? 😁
z
like clock work.... 🙂
@brettpr wanna try this build (drop it in your /deploy folder) https://drive.google.com/file/d/1D1W59Om9mUJEj-OwTlsuk0OyATd4Ue_T/view?usp=sharing it changes the null to "B"
b
@zackster - nope, sorry, it actually got worse...
Yesterday "ThêQuickBrownêFoxJumpsOverTheDog.docx" arrived with the correct name but today that file name is also corrupted.
It seems just a single diacritic character in a file name results in corruption of the file name.
ThêQuickBrownFoxJumpsOverTheDog.docx was also corrupted
But TheQuickBrownFoxJumpsOverTheDog.docx was not...
And just for good measure I tried TheQuickBrøwnFoxJumpsOverTheDog,docx and it also corrupted.