#32: file composed mail, and verify DNS records for real
Three things the console and the mail client were getting wrong. **Sent stayed empty and drafts would not save.** Both write through the same persistence path, and both failed on the same constraint: spf_result, dkim_result and dmarc_result are restricted to the RFC verdict vocabulary and are nullable, so "not evaluated" has to be NULL. The compose path left them at Go's zero value, which sends an empty string - satisfying neither the CHECK nor the meaning - and the insert was rejected. Filing the Sent copy is deliberately non-fatal, so it failed silently; saving a draft reported the error. Inbound mail was unaffected because it always supplies a real verdict, which is also why the existing test never caught it. **DNS reconciliation could not verify anything.** The console posted to the auth service, which has no resolver, so the endpoint recorded the request and re-read the status already in the database. The machinery to do it properly already existed - the background reconciler resolves every expected record through public resolvers - it just was not reachable from the console. Adds GET /api/v1/admin/dns/verify to the protocols service, which owns both the resolver and the record spec, and wires the domains screen to it: every expected record, its expected value, and whether it actually resolves. A proxied record is reported as present rather than matching, because behind a proxy the published answer is the provider's address and comparing values would always disagree. Reconciliation still runs afterwards so the stored status and the audit trail stay in step. The spec is read, never provisioned: opening a screen must not create DKIM keys as a side effect. Verified: the persistence test fails without the fix with the exact constraint violation (email_messages_dkim_result_check), 22 Go packages and 36 webmail tests green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8cfe339d13
commit
e5edee096c
10 files changed
+354
-25
No files matched your search
@@ -34,6 +34,9 @@ type Router struct {
|
||||
dkim *adminDkimAPI
|
||||
// tls reports what the certificate watcher sees, rather than a constant.
|
||||
tls *adminTlsAPI
|
||||
// dns verifies the published records against public resolvers. It lives
|
||||
// here because this is the process with the resolver and the record spec.
|
||||
dns *adminDnsAPI
|
||||
// degradedFunc reports a condition that leaves the service running but
|
||||
// not fit for production, the clearest case being a self-signed
|
||||
// certificate standing in for one Traefik never issued
|
||||
@@ -77,6 +80,7 @@ func (r *Router) registerRoutes() {
|
||||
r.mux.HandleFunc("/autodiscover/autodiscover.xml", r.handleOutlookAutodiscover)
|
||||
r.mux.HandleFunc("/api/v1/events", r.handleEvents)
|
||||
r.mux.HandleFunc("/api/v1/admin/tls", r.handleAdminTls)
|
||||
r.mux.HandleFunc("/api/v1/admin/dns/verify", r.handleAdminDnsVerify)
|
||||
r.mux.HandleFunc("/api/v1/admin/dkim/keys", r.handleAdminDkimKeys)
|
||||
r.mux.HandleFunc("/api/v1/admin/dkim/rotate", r.handleAdminDkimRotate)
|
||||
r.mux.HandleFunc("/api/v1/mail/folders", r.handleMailFolders)
|
||||
|
||||
Reference in new issue
Block a user