# Milestone C: email behaviour (continuity, CSAT, auto-resolve) ## Setup - SMTP: Brevo; sender lab@chatwoot.railsfanatics.com. SMTP test 1 (13:17:56Z) and test 2 (14:38:45Z) were received (test 1: mailbox/smtp-test-received.json, with DKIM/SPF/DMARC pass recorded for that test mail only; test 2 only in the supervisor report, no saved file). Config: smtp-setup.json. - C0 (inbound-domain fix): continuity mails failed with "Channel email domain not present." until `MAILER_INBOUND_EMAIL_DOMAIN` was set on the host (~15:20Z, per mailbox-check-2.json). See [C0-finding.md](C0-finding.md). Conversations 18-23 (C0-* rows in expected-emails.json) are not tested triggers; no late mail for them arrived (mailbox-check-2/3). - Re-run: conversations 25-30 (ops/e2e/c-rerun-chain.sh), controlled mailbox as visitor address, AgentBot detached, widget closed before each trigger. Results in rerun//. Settings restored afterwards (99-restored-rerun.json, restore-proof-rerun/). - "Agent reply" below is a scripted agent-user API reply (HUMAN_AGENT_TOKEN), not a human. ## Results | Scenario | Conv | Trigger | Settings | Chatwoot state (rerun files) | Email (mailbox JSON) | Shows | |---|---|---|---|---|---|---| | C1 | 25 | scripted agent reply 15:24:36Z (msg 114) to unseen visitor msg | continuity ON, CSAT off, auto-resolve off | open; msgs 113 (visitor), 114 (reply) | received 15:26:41Z "[#25] New messages on this conversation", visitor message + labelled scripted reply (check-2) | unseen reply sends a continuity summary ~2 min later | | C3 | 26 | manual resolve with label lab-csat 15:29:20Z; CSAT msg 118 (input_csat) | continuity ON, CSAT ON (rule label contains lab-csat) | resolved; CSAT message 118 + activity 119 | received 15:31:24Z same subject pattern "[#26]"; CSAT "Click here to rate" inside the summary email, no separate survey email (check-2) | CSAT survey is delivered inside the continuity summary | | C2 | 29 | auto-resolve after 10 min inactivity at 15:55:15Z; template msg 127 | continuity ON, CSAT off, auto_resolve_after 10, ignore_waiting false, message "Lab auto-resolve notice: ..." | resolved; template msg 127 with that text (type 3) + activity 128 | received 15:57:16Z "[#29] ...", body only the visitor message labelled "You"; auto-resolve text absent (check-3) | trigger present (email sent) but the auto-resolve text is filtered from the body | | F-C1 | 27 | scripted reply 15:34:06Z | continuity OFF | open; msgs 120, 121 | no email (as expected) (check-3) | continuity off stops the summary | | F-C3 | 28 | manual resolve 15:38:58Z | continuity ON, CSAT OFF | resolved; activity message only, no CSAT message | no email (as expected) (check-3) | CSAT off, nothing to send | | F-C2 | 30 | auto-resolve 16:10:28Z, blank message | continuity ON, CSAT off, auto_resolve_after 10, message blank | resolved; activity message 130 only, 0 template messages | none received (mailbox-check-4, 16:22Z) | blank message creates no template message (no email received) | Times are UTC. Subjects in the F rows are not applicable. ## Demonstrated - C1, C3, C2 each produced one email; F-C1 and F-C3 produced none. - CSAT survey arrives as a link inside the continuity summary. - Auto-resolve text is not in the email body although the email was sent (matches the v4.19.0 summary filter, docs/c-source-notes.md). - Auto-resolve with blank message created no template message in Chatwoot and no email arrived (F-C2, mailbox-check-4). ## Not tested / not shown - Real human replies; providers other than Brevo; bounce handling. - Queued mail after a setting change (only what was observed above). - Header authenticity of the scenario emails: raw headers not attached (evidence/C/raw/ pending). Only SMTP test 1 has recorded DKIM pass / SPF pass (Brevo bounce domain) / DMARC pass; SPF on the lab subdomain itself is not verified. Spam folder not checked in checks 2/3. - Message-ID values in expected-emails.json are inferred, not compared with received mail.