Comments (6)
We did fix some issues recently that seem similar to what you're describing. The issues occurred in an upstream library used by the batch-module (generic-object-pool, clustered-object-pool and smtp-connection-pool, which all form a chain of dependencies).
It might be worth to try 8.11.1. I have a feeling this has been solved already (but these things are always difficult to pinpoint).
from simple-java-mail.
Thanks for the feedback. I will define the version 8.11.1 in the next website update, and will see if the issue is solved.
from simple-java-mail.
@bbottema I updated the website with the version 8.11.1
today, and about after 40 minutes I received the following error twice:
2024-06-14 09:22:47,282 ERROR [org.simplejavamail.internal.util.concurrent.NamedRunnable] (Simple Java Mail async mail sender, executor 1 / thread 14864) Failed to run sendMail process: org.simplejavamail.mailer.internal.MailerException: Failed to send email [ID: '<1009748286.14863.1718367766467@acb1a9b87474>'], reason: Third party error
at deployment.app.war//org.simplejavamail.mailer.internal.SendMailClosure.handleException(SendMailClosure.java:85)
at deployment.app.war//org.simplejavamail.mailer.internal.SendMailClosure.executeClosure(SendMailClosure.java:72)
at deployment.app.war//org.simplejavamail.mailer.internal.AbstractProxyServerSyncingClosure.run(AbstractProxyServerSyncingClosure.java:59)
at deployment.app.war//org.simplejavamail.internal.util.concurrent.NamedRunnable.run(NamedRunnable.java:40)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
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:1623)
Caused by: jakarta.mail.MessagingException: Exception reading response;
nested exception is:
java.net.SocketException: Connection reset
at org.eclipse.angus.mail//org.eclipse.angus.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:2509)
at org.eclipse.angus.mail//org.eclipse.angus.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2386)
at org.eclipse.angus.mail//org.eclipse.angus.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:2128)
at org.eclipse.angus.mail//org.eclipse.angus.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1306)
at deployment.app.war//org.simplejavamail.mailer.internal.util.TransportRunner.lambda$sendMessage$0(TransportRunner.java:61)
at deployment.app.war//org.simplejavamail.mailer.internal.util.TransportRunner.sendUsingConnectionPool(TransportRunner.java:92)
at deployment.app.war//org.simplejavamail.mailer.internal.util.TransportRunner.runOnSessionTransport(TransportRunner.java:77)
at deployment.app.war//org.simplejavamail.mailer.internal.util.TransportRunner.sendMessage(TransportRunner.java:56)
at deployment.app.war//org.simplejavamail.mailer.internal.SendMailClosure.executeClosure(SendMailClosure.java:69)
... 6 more
Caused by: java.net.SocketException: Connection reset
at java.base/[sun.nio.ch](http://sun.nio.ch/).NioSocketImpl.implRead(NioSocketImpl.java:318)
at java.base/[sun.nio.ch](http://sun.nio.ch/).NioSocketImpl.read(NioSocketImpl.java:345)
at java.base/[sun.nio.ch](http://sun.nio.ch/).NioSocketImpl$1.read(NioSocketImpl.java:794)
at java.base/java.net.Socket$SocketInputStream.read(Socket.java:1025)
at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:483)
at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:477)
at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:70)
at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1461)
at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1066)
at org.eclipse.angus.mail//org.eclipse.angus.mail.util.TraceInputStream.read(TraceInputStream.java:107)
at java.base/[java.io](http://java.io/).BufferedInputStream.fill(BufferedInputStream.java:258)
at java.base/[java.io](http://java.io/).BufferedInputStream.implRead(BufferedInputStream.java:292)
at java.base/[java.io](http://java.io/).BufferedInputStream.read(BufferedInputStream.java:279)
at org.eclipse.angus.mail//org.eclipse.angus.mail.util.LineInputStream.readLine(LineInputStream.java:104)
at org.eclipse.angus.mail//org.eclipse.angus.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:2489)
... 14 more
It seems an error about sending a specific email, which could be fine, the issue is that it logs the error instead of just throwing an exception that can be caught after calling future.get()
(I don't know if future.get()
throws the exception tough).
This is not about the original error of this issue, but the original error (dealocating) only happened rarely, some days it didn't even happen, so I wait a few days to see if that error happens.
But regarding this new error, is there something that I can do so that it's not directly logged as error, and just throw an exception that I can handle when calling future.get()
?
from simple-java-mail.
@bbottema Another exception that happened after updating (Can't send command to SMTP host
):
2024-06-14 09:43:29,356 ERROR [org.simplejavamail.internal.util.concurrent.NamedRunnable] (Simple Java Mail async mail sender, executor 1 / thread 24981) Failed to run sendMail process: org.simplejavamail.mailer.internal.MailerException: Failed to send email [ID: '<452494817.24980.1718369008650@acb1a9b87474>'], reason: Third party error
at deployment.app.war//org.simplejavamail.mailer.internal.SendMailClosure.handleException(SendMailClosure.java:85)
at deployment.app.war//org.simplejavamail.mailer.internal.SendMailClosure.executeClosure(SendMailClosure.java:72)
at deployment.app.war//org.simplejavamail.mailer.internal.AbstractProxyServerSyncingClosure.run(AbstractProxyServerSyncingClosure.java:59)
at deployment.app.war//org.simplejavamail.internal.util.concurrent.NamedRunnable.run(NamedRunnable.java:40)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
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:1623)
Caused by: jakarta.mail.MessagingException: Can't send command to SMTP host;
nested exception is:
java.net.SocketException: Connection or outbound has closed
at org.eclipse.angus.mail//org.eclipse.angus.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:2464)
at org.eclipse.angus.mail//org.eclipse.angus.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:2451)
at org.eclipse.angus.mail//org.eclipse.angus.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:2367)
at org.eclipse.angus.mail//org.eclipse.angus.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2404)
at org.eclipse.angus.mail//org.eclipse.angus.mail.smtp.SMTPTransport.finishData(SMTPTransport.java:2128)
at org.eclipse.angus.mail//org.eclipse.angus.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1306)
at deployment.app.war//org.simplejavamail.mailer.internal.util.TransportRunner.lambda$sendMessage$0(TransportRunner.java:61)
at deployment.app.war//org.simplejavamail.mailer.internal.util.TransportRunner.sendUsingConnectionPool(TransportRunner.java:92)
at deployment.app.war//org.simplejavamail.mailer.internal.util.TransportRunner.runOnSessionTransport(TransportRunner.java:77)
at deployment.app.war//org.simplejavamail.mailer.internal.util.TransportRunner.sendMessage(TransportRunner.java:56)
at deployment.app.war//org.simplejavamail.mailer.internal.SendMailClosure.executeClosure(SendMailClosure.java:69)
... 6 more
Caused by: java.net.SocketException: Connection or outbound has closed
at java.base/sun.security.ssl.SSLSocketImpl$AppOutputStream.write(SSLSocketImpl.java:1297)
at org.eclipse.angus.mail//org.eclipse.angus.mail.util.TraceOutputStream.write(TraceOutputStream.java:120)
at java.base/[java.io](http://java.io/).BufferedOutputStream.flushBuffer(BufferedOutputStream.java:125)
at java.base/[java.io](http://java.io/).BufferedOutputStream.implFlush(BufferedOutputStream.java:252)
at java.base/[java.io](http://java.io/).BufferedOutputStream.flush(BufferedOutputStream.java:240)
at org.eclipse.angus.mail//org.eclipse.angus.mail.smtp.SMTPTransport.sendCommand(SMTPTransport.java:2462)
... 16 more
The main issue is that I can't handle these errors. I send lots of emails every day and it's expected that some of them fail, so is there a way to make it just throw the error so that I can handle it instead of logging the error and bloating our error logs? (maybe changing some setting to not log errors and just throw them or something similar)
from simple-java-mail.
Yes, I will give it some thought. It will take at least a week or two to come up with a fix, since I'm on (a short) vacation starting this weekend.
from simple-java-mail.
@bbottema Ok, thanks!
from simple-java-mail.
Related Issues (20)
- Make S/MIME algorithms configurable (signature algorithm for signing, key encapsulation and cipher algorithms for encryption) HOT 4
- [Enhancement] Expose finer-grained DKIM configuration through the builder api and disable 'l-param' by default HOT 12
- [bug] Fix parsing addresses from headers in EML files, like a Disposition-Notification-To with umlaut HOT 1
- Update outlook-message-parser dependency, which has improved support for X500 addresses
- [Bug] Message headers not treated with case insensitivity as per RFC, causing deviating headers to slip through the filters HOT 1
- Maxing out SMTP server concurrent connections HOT 1
- outlookMsgToEmail duplicates recipients if same name used for To and Cc HOT 1
- java.lang.NoClassDefFoundError: org/jacoco/agent/rt/internal_c13123e/Offline HOT 2
- [security] Update 3rd party dependencies to get rid of all currently known CVE issues HOT 2
- [enhancement+bug] Make EmailConverter API more consistent regarding Session parameter, don't use `Session.getDefaultInstance` anymore and fix bug where `emlToEmailBuilder` used `emlToMimeMessage` HOT 3
- How to create jakarta.mail.internet.MimeMessage without accessing the mailer session? HOT 3
- Update upstream dependency generic-object-pool, which solves a critical bug when there are exceptions during allocation HOT 1
- How to esclude embedded image in email HOT 2
- When reading .msg files the RTF converted to HTML is garbled in some cases where the appropriate charset is not detected properly HOT 6
- Bump smtp-connection-pool from 2.3.2 to 2.3.3 which improves performance and fixes a rare ConcurrentModificationException HOT 1
- [Bug] After converting Outlook .msg to EML, bullet lists have duplicate numbering HTML converted from RTF HOT 3
- Wrong sent date when parsing mail HOT 3
- Trying to add a application/x-xz; charset=binary (tar.xz) attachment ... HOT 12
- Unable to parse .msg file - Block 20736 not found HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-java-mail.