Lucee stops sending email

Email stops being sent after a few hours, I think some gets delayed somewhere and is eventually sent sometime after the restart but not immediately (I need to investigate this more). I thought it might be a grey listing issue but after restarting Lucee and IIS email is sent and received instantly.

The email is being sent from Lucee via Office 365.

There are no failed email Tasks in Web Admin.

I have seen other posts from 2016 & 2017 with same issue but no solutions.

Same issue on &

Any ideas?

Don’t forget to tell us about your stack!

OS: Win Server 2019
Java Version: 11.0.3
Tomcat Version: 9.0.20
Lucee Version: &

Possibly this:

Thanks Jamie.

I have found the error in an unsent email Task is: Could not convert socket to TLS lucee.runtime.exp.NativeException: Could not convert socket to TLS

This has been reported before but not on What I really don’t understand is why does this work and then stop overnight?
What could be changing?

can you post the top of the stacktrace, say 10 lines?

I just sent an email and it has not been received and there is nothing is in the Web Admin Tasks.
Restarted Lucee, sent another email and it was sent and received instantly.

Is this what you mean? Could not convert socket to TLS lucee.runtime.exp.NativeException: Could not convert socket to TLS
at com.sun.mail.smtp.SMTPTransport.startTLS(
at com.sun.mail.smtp.SMTPTransport.protocolConnect(
at javax.mail.Service.connect(
at Caused by: javax.mail.MessagingException: Could not convert socket to TLS; nested exception is: A potential protocol version downgrade attack
… 4 more Caused by: A potential protocol version downgrade attack
at java.base/
at java.base/
at java.base/
at java.base/
at java.base/
at java.base/$ServerHelloConsumer.onServerHello(
at java.base/$ServerHelloConsumer.consume(
at java.base/
at java.base/
at java.base/
at java.base/
at java.base/
at java.base/
at java.base/
at java.base/
at com.sun.mail.util.SocketFetcher.configureSSLSocket(
at com.sun.mail.util.SocketFetcher.startTLS(
at com.sun.mail.smtp.SMTPTransport.startTLS(

thanks, that’s informative.

I have filed a bug

@isapir was the last developer to work on these TLS issues, which was before the release.

You could try updating to Java 11.0.7

1 Like

I wonder if it is trying TLSv1.0 or something. Maybe disabling in

jdk.tls.disabledAlgorithms= SSLv2Hello, SSLv3, TLSv1, TLSv1.1

or is firewall doing something to smtp port.

Thanks for suggestions and adding the bug, I will keep an eye on it.
I tried upgrading the jre by simply copying in the latest folders (bin, conf, legal, lib) from the link: OpenJDK11U-jre_x64_windows_hotspot_11.0.7_10. But Lucee would not restart so put the old ones back. I will try again when I get a few minutes.

I have added TLSv1, TLSv1.1 to this jdk.tls.disabledAlgorithms= in \lucee\jre\conf\security\

I will update this if I anything changes or I find anything useful.

you can also do that directly from cfml

System = createObject("java", "java.lang.System");
System.setProperty("mail.debug", "true");
System.setProperty("mail.smtp.ssl.protocols", "TLSv1.2");

Where do I put that code? Application.cfc or before every email is sent?

I found that adding
jdk.tls.disabledAlgorithms= TLSv1, TLSv1.1 in \lucee\jre\conf\security\
stopped the imap code below connecting. It must default to TLS 1 or 1.1 ?
Adding this line fixed it:

So if I can set Lucee to always send emails with TLS 1.2 it might fix the issue.

properties = createObject(“Java”,“java.util.Properties”);
jsession = createObject(“Java”,“javax.mail.Session”);
store = createObject(“Java”,“javax.mail.Store”);
message = CreateObject(“Java”, “javax.mail.Message”);

	properties.put("mail.from", mailSettings.username);
	properties.put("mail.imaps.port", mailSettings.port);

// add this line to make it work

	jsession = jsession.getInstance(properties);
	store = jsession.getStore("imaps");
	store.connect(mailSettings.server, mailSettings.username, mailSettings.password);

	inbox = store.getFolder("#mailSettings.folder#");
	VARIABLES.message_count = inbox.getMessageCount();

Looking at the JDK release notes, there have been changes to TLS 1.2 negotiation in updated JDKs.
You might have to download from (or Oracle if that is what you use) and get the latest 11.0.8 and install. How did you install Lucee? I haven’t tested the Lucee installer in Windows. I know in Linux you can just extract the JDK and renmae the /opt/lucee/jdk directory. Windows uses registry values sometimes and you might have to change those.

If you have a internet accessible website you also need to update Tomcat libs. There have been security updates.

That is interesting as I have not had the error since I have added this: properties.put(“mail.imaps.ssl.protocols”,“TLSv1.2”);

Maybe Office 365 did not like the site trying to connect with TLS 1 in some places and TLS 1.2 in others.

I will still upgrade when I get the time but it might be fixed for now…

1 Like