Cfmail timeout not working


#1

Hello,

I am working with cfmail and it times out for office365 / outlook / msn type accounts. It was working and from what I can tell, it seems like it might be related to the server the DNS provides. IE, from my local computer it takes 10 seconds to run, but on our live server it takes a random amount of, most often timing out. But it returns different IPs from the DNS depending on where I connect from. Also, a week ago it was working. So the idea was to increase the timeout so even if it is slower, it will still work; however, it always times out around 42 seconds even setting higher timeouts. Does anyone know what might cause this or if there is a workaround?

<cfsetting requesttimeout="900">
<cfmail attributecollection="#MailSettings#" timeout="120" async="false">
This is a test email.
</cfmail>
"ERROR","ajp-nio-8901-exec-2","10/30/2017","10:05:42","","mail;Could not connect to SMTP host: smtp-mail.outlook.com, port: 587;lucee.runtime.exp.NativeException: Could not connect to SMTP host: smtp-mail.outlook.com, port: 587
	at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
	at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:319)
	at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:237)
	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1927)
	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)
	at javax.mail.Service.connect(Service.java:295)
	at lucee.runtime.net.smtp.SMTPSender.run(SMTPSender.java:65)
Caused by: java.net.ConnectException: Connection timed out: connect
	... 14 more

#2

We found out this was related to an ISP throttle on specific outbound email ports, so we are up and running again. The timeout still didn’t work as I would have expected, it seems to me it would continue to attempt the connection for as long as the specified timeout.