From 22e5cf68e3438b489205427704202223f66e2b15 Mon Sep 17 00:00:00 2001 From: Andy Anderson Date: Mon, 16 Nov 2026 20:26:14 -0500 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9C=A8=20Show=20why=20a=20calendar-email?= =?UTF-8?q?=20proof=20failed=20on=20its=20Settings=20row?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Record a failure summary on the entry (reason code, time, SPF, DKIM, alignment and domains, never message content), expose it as last_failure in the calendar-emails API with a plain-language message and remedy, and render it on the row with a Check again button. Expired codes are now recognized and reported as expired. Unknown-code proof attempts are kept, masked, for the owner as recent_proof_attempts. Fixes #18579 Signed-off-by: Andy Anderson --- .../added-18579-proof-failure-reason.md | 1 + dashboard/openapi.json | 16 ++- src/docs/api-reference/knowledge.md | 4 +- src/docs/meetings.md | 12 ++ src/pkg/dashboard/api_meetings_email.go | 52 ++++++- src/pkg/dashboard/api_meetings_email_test.go | 91 ++++++++++++ src/pkg/dashboard/meeting_attendee_ui_test.go | 15 +- .../static-src/js/meeting-attendee.js | 34 ++++- src/pkg/dashboard/static/index.html | 34 ++++- src/pkg/mailallow/mailallow.go | 130 ++++++++++++++++-- src/pkg/mailallow/mailallow_test.go | 91 +++++++++++- 11 files changed, 452 insertions(+), 28 deletions(-) create mode 100644 changelog.d/added-18579-proof-failure-reason.md diff --git a/changelog.d/added-18579-proof-failure-reason.md b/changelog.d/added-18579-proof-failure-reason.md new file mode 100644 index 0000000000..304d1415c3 --- /dev/null +++ b/changelog.d/added-18579-proof-failure-reason.md @@ -0,0 +1 @@ +- **A calendar email whose proof mail was refused now says why** under **Settings, Meeting attendee, My calendar emails**, instead of only "pending": the reason in plain words with what to do (not authenticated by the sender's mail server, sent from a different address, or the code expired), when it arrived, and the SPF, DKIM and alignment results hive-mx saw (results and domains only, never the message), with a **Check again** button. The calendar-emails API carries the same summary as `last_failure`. A proof mail whose code matches no address shows, sender masked, under the owner's **Recent proof attempts** (`recent_proof_attempts`, owner only). ([#18579](https://github.com/hivecommons/hive/issues/18579)) diff --git a/dashboard/openapi.json b/dashboard/openapi.json index de5cfe254f..bdac1a302a 100644 --- a/dashboard/openapi.json +++ b/dashboard/openapi.json @@ -807,7 +807,7 @@ "Meetings" ], "summary": "List my calendar emails", - "description": "The signed-in user's calendar email addresses with proof status and pending codes, the hive's address (hive@) and the meetings.email switches. ?all=1 adds the whole allowlist for the owner. Any role.", + "description": "The signed-in user's calendar email addresses with proof status and pending codes, the hive's address (hive@) and the meetings.email switches. An unproven address whose latest proof mail was refused carries last_failure. The owner also gets recent_proof_attempts (proof mails whose code matched no address, sender masked). ?all=1 adds the whole allowlist for the owner. Any role.", "parameters": [ { "name": "all", @@ -834,14 +834,14 @@ "type": "array", "items": { "type": "object", - "description": "Calendar email: email, proven, proven_at, code (pending proof code, own list only), code_expires_at, last_error, active (the user still has access), login (owner allowlist only)" + "description": "Calendar email: email, proven, proven_at, code (pending proof code, own list only), code_expires_at, last_error, active (the user still has access), login (owner allowlist only), last_failure (latest refused proof: reason not_aligned, from_mismatch or expired; at; from_domain, spf, spf_domain, spf_aligned, dkim [{domain, result}], dkim_aligned, dmarc, aligned; message, the reason in plain words with what to do)" } }, "allowlist": { "type": "array", "items": { "type": "object", - "description": "Calendar email: email, proven, proven_at, code (pending proof code, own list only), code_expires_at, last_error, active (the user still has access), login (owner allowlist only)" + "description": "Calendar email: email, proven, proven_at, code (pending proof code, own list only), code_expires_at, last_error, active (the user still has access), login (owner allowlist only), last_failure (latest refused proof: reason not_aligned, from_mismatch or expired; at; from_domain, spf, spf_domain, spf_aligned, dkim [{domain, result}], dkim_aligned, dmarc, aligned; message, the reason in plain words with what to do)" } }, "invites_enabled": { @@ -849,6 +849,14 @@ }, "files_enabled": { "type": "boolean" + }, + "recent_proof_attempts": { + "type": "array", + "description": "Owner only: recent proof mails whose code matched no address, newest first; kept in memory", + "items": { + "type": "object", + "description": "Proof attempt: at, from (masked, a***@example.com), reason (code not recognized)" + } } } } @@ -897,7 +905,7 @@ "properties": { "email": { "type": "object", - "description": "Calendar email: email, proven, proven_at, code (pending proof code, own list only), code_expires_at, last_error, active (the user still has access), login (owner allowlist only)" + "description": "Calendar email: email, proven, proven_at, code (pending proof code, own list only), code_expires_at, last_error, active (the user still has access), login (owner allowlist only), last_failure (latest refused proof: reason not_aligned, from_mismatch or expired; at; from_domain, spf, spf_domain, spf_aligned, dkim [{domain, result}], dkim_aligned, dmarc, aligned; message, the reason in plain words with what to do)" }, "address": { "type": "string" diff --git a/src/docs/api-reference/knowledge.md b/src/docs/api-reference/knowledge.md index dee53ced6e..09f2cf6a58 100644 --- a/src/docs/api-reference/knowledge.md +++ b/src/docs/api-reference/knowledge.md @@ -119,7 +119,7 @@ Part of the [Dashboard REST API reference](../api-reference.md); see that page f | `POST` | `/api/meetings/persona/sample` | Owner or read-write | Speak a short line through the meetings TTS service (Kokoro `POST /v1/audio/speech`) and return the audio (`audio/mpeg`, at most 2 MiB, `Cache-Control: no-store`). Optional `{voice?, language?, display_name?, text?}` (unsaved form values; `text` at most 200 characters, default the persona's sample line in its language). 503 "TTS not configured" until `meetings.tts_url` is set, 400 invalid, 502 the TTS service failed | `pkg/dashboard/api_meetings_persona.go:166` | | `GET` | `/api/meetings/persona/sample` | Owner or read-write | The same sample with `voice`, `language`, `display_name` and `text` as query parameters, for the dashboard's `