blossom-project / blossom

Blossom is a Java framework based on Spring-Boot which enables you to realize your projects quickly and smoothly. It comes with several modules and tools made to ease and speed up your development process.
http://blossom-project.com
Apache License 2.0
21 stars 21 forks source link

500 error on status page when SMTP is not available #229

Open abenoit-reeliant opened 4 years ago

abenoit-reeliant commented 4 years ago

When the SMTP server that is configured in Blossom doesn't respond, the /blossom/public/status URL responds with a 500 HTTP response, with an empty body, instead of responding with a normal response containing : "mail":{"status":"DOWN"}

Steps to reproduce issue: Stop the SMTP server

Expected Result: A normal response with "mail":{"status":"DOWN"} in the body.

Actual Result: A 500 HTTP response with an empty body.

When this occurs, the following exception is visible in the application logs:

org.springframework.boot.actuate.mail.MailHealthIndicator health
WARNING: Mail health check failed
com.sun.mail.util.MailConnectException: Couldn't connect to host, port: localhost, 25; timeout -1;
  nested exception is:
        java.net.ConnectException: Connection refused (Connection refused)