-
Notifications
You must be signed in to change notification settings - Fork 40.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Health actuator mail details shows the port as -1 when using the default port #35247
Comments
This doesn't seem to have worked. Now it shows |
That's intentional. The port isn't shown when using the default, just as it typically isn't shown on web addresses that are using port 80.
I've retitled the issue and updated the changelog to match. Hopefully that removes the confusion. |
Ah ok. I was hoping it would confirm which port it's ended up using. We can tell for a web address because it says http: or https:, but SMTP it depends on the other settings (which can also be defaults). |
Unfortunately, that information isn't readily available. We'd need to be able to call |
A ticket with spring-core to make it |
A sub-class won't be reliable as someone may define their own bean. If this is something that'd like to see, I think a Framework issue is the next step you should take. |
Based on preliminary inspection, it appears that At least, based on a quick glance at the code ( @wilkinsona, were you able to verify that |
As a side note, what happens with regard to what |
I thought I had, but it looks like I was mistaken. Looking at the code again now and stepping through things in the debugger, I agree with your assessment, Sam. As far as I can tell, the port is updated locally for logging purposes but isn't updated in any state that can be subsequently accessed. This leaves the |
That was the same conclusion I came to.
No worries. Thanks for confirming there's nothing we can do here. I'll close spring-projects/spring-framework#30507 accordingly. Though I'm still curious about #35247 (comment). |
The health indicator uses the values returned from |
Fair enough. 👍 Thanks for elaborating. |
When mail is autoconfigured and
spring.mail.port
is not defined, the health contributor shows the port as-1
instead of what is actually used.The text was updated successfully, but these errors were encountered: