iloveeyjafjalla opened a new pull request, #6857:
URL: https://github.com/apache/rocketmq-dashboard/pull/6857
## Which Issue(s) This PR Fixes
Fixes #6856
## Problem / Evidence
`docs/studio-native-alerting-design.md` tells operators to configure the
email channel with `STUDIO_ALERTING_SMTP_HOST`, `_PORT`, `_USERNAME`,
`_PASSWORD`, `_AUTH` and `_STARTTLS`. Four of the six are bridged in
`application.yml`, the socket timeouts are bridged too, and the two transport
switches are literals:
```yaml
mail.smtp.auth: true
mail.smtp.starttls.enable: true
```
Nothing maps either variable onto `spring.mail.properties.mail.smtp.auth` /
`...starttls.enable`: there is no `${...}` bridge, and the relaxed-binding path
`studio.alerting.smtp.auth` matches neither `AlertingProperties` (prefix
`studio.alerting`, no `smtp` field) nor `spring.mail`. So the literals always
win, and an operator pointing Studio at a relay that needs no credentials, or
that speaks implicit TLS on 465 instead of STARTTLS on 587, sees delivery fail
with the relay's own rejection while the value they configured is silently
ignored. Same shape as the socket timeouts #6071 had to wire.
## Fix
Bridge both the way the rest of the block is bridged:
```yaml
mail.smtp.auth: ${STUDIO_ALERTING_SMTP_AUTH:true}
mail.smtp.starttls.enable: ${STUDIO_ALERTING_SMTP_STARTTLS:true}
```
The defaults stay `true`, so nothing changes for a deployment that does not
set the variables.
## Tests
New `SmtpEnvironmentConfigurationTest` loads the real `application.yml`
through a context runner. Before the change:
```
SmtpEnvironmentConfigurationTest.smtpAuthShouldHonourTheDocumentedEnvironmentOverrideTest
-- <<< FAILURE!
expected: "false"
but was: "true"
SmtpEnvironmentConfigurationTest.smtpStartTlsShouldHonourTheDocumentedEnvironmentOverrideTest
-- <<< FAILURE!
expected: "false"
but was: "true"
Tests run: 3, Failures: 2, Errors: 0, Skipped: 0
```
After the change, together with the notification suites that consume the
mail session:
```
Tests run: 47, Failures: 0, Errors: 0, Skipped: 0
(SmtpEnvironmentConfigurationTest 3, NotificationOutboxServiceTest 36,
AlertNotificationSuppressionServiceTest 8)
```
Two lines of configuration plus a test; the senders and the outbox are
untouched. The change was prepared with AI assistance and reviewed, tested and
verified by me.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]