What happened
The test button could check a different SMTP server from real platform mail. The earlier deployment-only direction was an implementation mistake after the source decision changed. This repair uses the saved Admin Settings server and clearly separates incomplete settings from a service outage.
What we need to do
Review this corrected source with the status and Admin companions. Merge only after named approval, verify the actual Dev configuration and deployed revision, then inspect the received test mail. Current local success is not Dev acceptance.
Original proposal — historical deployment-source direction
The story below is retained as history. Its SMTP-source choice was superseded on 29 September; the current implementation is described above.
The "send test mail" button now uses the deployment-owned platform SMTP server for host, port, secure mode, sender and credentials. The request chooses the recipient; extra legacy server or theme fields cannot change the transport or platform brand. This matches the account and invitation mail source chosen in UserService #1253.
- Only platform admins may send the test; tenant, user and technical accounts receive 403.
- STARTTLS is required when implicit TLS is off; certificate identity and 10-second connect/read/write timeouts remain enforced.
- Missing deployment values stop before transport and name the setting. Unexpected SMTP replies and account addresses are not printed in the response or server log.
- The branch includes the shared provider from PR #1273. It targets
dev; merge Use deployment SMTP for invitations and DPA notices #1273 first so this comparison narrows to the SMTP-test work.
Current architecture decision — implemented in this source
Platform test mail now reads one saved Admin Settings / ConsultingTypeService snapshot using the technical service identity. The same snapshot supplies the connection and sender. The request chooses only the recipient; legacy request fields and deployment SMTP values cannot override the saved server.
Missing saved fields produce a named configuration error before connecting. A settings-service or technical-identity outage produces a safe availability error instead of pretending SMTP is unconfigured. The configured product name is required; no hardcoded product/provider name is restored. Shared encrypted delivery, certificate checks and timeouts are retained.
Admin companion — same diagnostic package
Status PR #1287 builds on this exact source. Admin PR #1085 is being reworked to retain editable saved settings, protect credentials and require an acknowledged save before testing. The page must not imply that a test checks unsaved draft values. Neither companion is claimed deployed.
How to test it quickly
- Save a test server in Admin Settings and provide a different deployment server → only the saved Admin server receives the test mail; legacy request fields cannot redirect it.
- Remove a required saved credential → sending stops before connection and reports the missing setting without exposing credentials.
- Make the settings service unavailable → the test reports that it could not read settings; it does not report a missing password or expose the upstream reply.
- Invoke the test as a tenant admin or technical account → access is denied. A platform admin in tenant zero may invoke it.
- Configure an explicit product name and a TLS-capable server → receive the expected branded test mail. Missing name or required TLS fails clearly; there is no default-name or insecure fallback.
Verification and remaining gates
The repaired source is published and independently reviewed. Targeted local tests, package and formatting checks passed. All twelve current-head workflow checks passed on 30 September. Human review remains; merge, deployment and received mail are separate gates. No merge, deployment or received test mail is claimed.
Before rollout, verify that the deployment supplies the configured product name. The current Helm chart already wires that input; the actual Dev value was not read in this source check. Final seven-language/template alignment belongs to the wider email delivery, not this diagnostic repair.
For developers — exact source and local evidence:
Head: 10b899bf24db5e36ee3f966054b49e6c95a6d5d3; tree e1fae322b5eae3ea4215e202b7d2d1b8e77a29b0.
Normal merge: original ce554224eee6dab8ddb630fafb9863913623c8c9 + dev ed142cb46c0fcda8c869e0a3d1c8d7e08333b3dd.
One conflict repaired: GlobalSmtpTestEmailService.java. Earlier commits preserved; no force push.
Actual dev PR diff: 19 files, +657/-246. Immutable independent source review PASS.
Local: 181 unique tests / 13 fresh reports, zero failures/errors/skips; includes five HTTP authorization tests.
Meaningful regressions: settings/error/privacy RED 25 tests/3 failures; configured-name RED 16 tests/9 failures; final selected suite GREEN.
Focused session31879, package84686, Spotless33776: returned exit0; logs and fresh XML independently inspected.
Package: ./mvnw -B -q package -DskipTests -Dskip.unit-tests=true -Dskip.integration-tests=true
Formatting: ./mvnw -B -q spotless:check; diff check passed.
HTTP contract: incomplete saved configuration 400; typed CTS/technical-identity unavailable 502; fixed safe replies.
EMAIL_BRANDING_NAME required; Helm .Values.userService.emailBrandingName binding exists at dev9678bf6.
Shared OrisoSmtpTransport, renderer and both resource trees equal integrated dev. Retained three-tone baseline has no manifest; this does not prove all seven variants.
No new full-suite run, runtime response-header acceptance, deployment, TLS handshake or mailbox receipt claim.
Historical verification of the original deployment-source proposal
Current head ce554224e integrates updated provider PR #1273 and current dev. Two test conflicts were resolved: the invitation test uses the current example-host fixture, and the new deployment-SMTP test-mail checks replace obsolete Admin/ConsultingTypeService SMTP tests. Local Java 21: 5,073 tests passed with no failures/errors/skips; 28 focused provider/invitation/test-mail tests, Spotless and diff check passed. All 11 named current-head GitHub checks passed. Human review, merge, Dev deployment and received test mail remain open. The earlier head built a Maven package. PR #1273 is a merge dependency. Keycloak one-time-code mail remains a separate platform source follow-up.
Review follow-up
The older request to distinguish an unavailable ConsultingTypeService from incomplete SMTP is relevant again under the approved Admin source. It is now addressed by the strict raw snapshot and a typed, fixed-safe availability error. Local regression tests cover the actual settings-to-controller path and verify that neither upstream payloads nor raw exceptions leak. Human review remains open.
Historical developer details for the original proposal:
For developers — merge details (skip if you only need the outcome):
Base: dev
Head: ce554224e
Issue: OpenResilienceInitiative/ORISO-UserService#1280
Dependency: OpenResilienceInitiative/ORISO-UserService#1273
Local full suite: 5,073 tests, 0 failures/errors/skips; focused provider/invitation/test-mail suite: 28 tests.
Closes #1280
Refs OpenResilienceInitiative/ORISO-Frontend#828
🤖 Generated with Claude Code