Member since
07-25-2025
1
Post
0
Kudos Received
0
Solutions
02-25-2026
02:57 AM
Hello everyone, I have been trying to solve an issue on my on-prem NiFi 2.4.0 application for a month which being PutEmail timeout errors. Specifically, we were using NiFi 1.9.0 and local smtp server to send mails, after updating to 2.4.0 we started using office365 smtp server. swaks --server smtp.office365.com --port 587 --tls --helo test.local --auth LOGIN --auth-user notifymail@****.com --auth-password '****' --from notifymail@****.com --to okan.ergun@****.com --header "Subject: Test Email" --body "Test SMTP Relay Service" With the command above I never had timeouts, and every mail was successful from the application environment, although NiFi gets timeouts time to time and doesn't have any specific times to have timeouts. Processor Details: SMTP Hostname smtp.office365.com SMTP Port 587 Authorization Mode Use Password SMTP Username notifymail@****.com SMTP Password Sensitive value set SMTP Auth true SMTP STARTTLS true SMTP Socket Factory ${literal('')} SMTP X-Mailer Header NiFi Attributes to Send as Headers (Regex) No value set Content Type text/plain From notifymail@****.com To okan.ergun@****.com CC No value set BCC No value set Reply-To No value set Subject Test from NiFi Message Test Flow file content as message false Input Character Set UTF-8 Attach File true Include All Attributes In Message false PutEmail[id=99041462-0dcf-31ed-e46c-45b560f51973] Failed to send email for FlowFile[filename=48b2d732-915c-4a3e-a5d4-a1c0cdcb1e7c]: Couldn't connect to host, port: smtp.office365.com, 587; timeout -1; routing to failure: org.eclipse.angus.mail.util.MailConnectException: Couldn't connect to host, port: smtp.office365.com, 587; timeout -1; nested exception is: java.net.ConnectException: Connection timed out - Caused by: java.net.ConnectException: Connection timed out 2026-02-25 13:24:41,375 ERROR [Timer-Driven Process Thread-5] o.a.nifi.processors.standard.PutEmail PutEmail[id=99041462-0dcf-31ed-e46c-45b560f51973] Failed to send email for StandardFlowFileRecord[uuid=48b2d732-915c-4a3e-a5d4-a1c0cdcb1e7c,claim=,offset=0,name=48b2d732-915c-4a3e-a5d4-a1c0cdcb1e7c,size=0]: Couldn't connect to host, port: smtp.office365.com, 587; timeout -1; routing to failure org.eclipse.angus.mail.util.MailConnectException: Couldn't connect to host, port: smtp.office365.com, 587; timeout -1 at org.eclipse.angus.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2243) at org.eclipse.angus.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:729) at jakarta.mail.Service.connect(Service.java:364) at jakarta.mail.Service.connect(Service.java:222) at jakarta.mail.Service.connect(Service.java:171) at jakarta.mail.Transport.send0(Transport.java:230) at jakarta.mail.Transport.send(Transport.java:100) at org.apache.nifi.processors.standard.PutEmail.send(PutEmail.java:654) at org.apache.nifi.processors.standard.PutEmail.onTrigger(PutEmail.java:497) at org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27) at org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1272) at org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:244) at org.apache.nifi.controller.scheduling.AbstractTimeBasedSchedulingAgent.lambda$doScheduleOnce$0(AbstractTimeBasedSchedulingAgent.java:59) at org.apache.nifi.engine.FlowEngine.lambda$wrap$1(FlowEngine.java:105) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java.base/java.lang.Thread.run(Thread.java:1583) Caused by: java.net.ConnectException: Connection timed out at java.base/sun.nio.ch.Net.connect0(Native Method) at java.base/sun.nio.ch.Net.connect(Net.java:589) at java.base/sun.nio.ch.Net.connect(Net.java:578) at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:583) at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327) at java.base/java.net.Socket.connect(Socket.java:751) at java.base/java.net.Socket.connect(Socket.java:686) at org.eclipse.angus.mail.util.SocketFetcher.createSocket(SocketFetcher.java:368) at org.eclipse.angus.mail.util.SocketFetcher.getSocket(SocketFetcher.java:243) at org.eclipse.angus.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2193) ... 19 common frames omitted 2026-02-25 13:24:41,375 INFO [Timer-Driven Process Thread-5] o.a.n.c.s.StandardProcessScheduler Stopping PutEmail[id=99041462-0dcf-31ed-e46c-45b560f51973] Thank you for responding before-hand, I would appreciate any criticism also.
... View more
Labels:
- Labels:
-
Apache NiFi