2.3 KiB
2.3 KiB
Task 01 — SMTP / MailPit configuration
- Status: Done — 2026-08-20
- Depends on: —
- Size: S
Goal
Make the existing Mail/ infrastructure (already in the tree and registered in Program.cs) actually usable: add the missing "Smtp" configuration section so MailSender has a host, port, sender, and recipient.
Context
plushealthtech/Mail/MailSender.cs— sends viaSmtpClient,EnableSsl = false, no credentials. Do not recreate or rewire — it is registered as a singleton inProgram.csfrom the"Smtp"section.plushealthtech/Mail/SmtpOptions.cs—Host(defaultlocalhost),Port(default1025),From/To(default empty →MailSenderthrows if submitted while empty).- No
"Smtp"section exists in any appsettings file — that is the gap.
Files
- Modify:
plushealthtech/appsettings.json
Steps
-
Add this section to
plushealthtech/appsettings.json(base config — the MailPit server is the same in every environment):"Smtp": { "Host": "tools.host.domain", "Port": 1025, "From": "[email protected]", "To": "[email protected]" }Fromis an assumption (MailPit does not validate the sender) — single point of change if a different sender address is wanted. -
dotnet build plushealthtech.sln— must stay green (no code changes expected). -
Confirm
tools.host.domainresolves from this machine (nslookup tools.host.domainorping -n 1 tools.host.domain). If it only resolves on the internal network, note that dev machines will need a hosts entry.
Acceptance criteria
appsettings.jsoncontains theSmtpsection exactly as above.- Build green.
- Host name resolution confirmed (or documented as internal-network-only).
- End-to-end delivery proven in Task 13 (form submit → message visible in MailPit for
[email protected]).
Notes
Fromempty would throwArgumentExceptioninMailMessage— this task removes that failure mode.- Resolution check (2026-08-20):
tools.host.domainresolves to10.10.0.30via the internal router DNS (vrouter.home.domain, 10.10.0.1) and answers ping; TCP port 1025 is open. It is internal-network-only — dev machines off that network will need a hosts entry fortools.host.domain.