composeHumanOutbound stands in for a Gmail user sending to an agent — no Reply-To, no X-E2A-* headers, envelope from Gmail's MTA.
(t *testing.T, human, to, subject, body, replyToMsgID string)
| 57 | // composeHumanOutbound stands in for a Gmail user sending to an agent — |
| 58 | // no Reply-To, no X-E2A-* headers, envelope from Gmail's MTA. |
| 59 | func composeHumanOutbound(t *testing.T, human, to, subject, body, replyToMsgID string) []byte { |
| 60 | t.Helper() |
| 61 | var buf strings.Builder |
| 62 | fmt.Fprintf(&buf, "From: %s\r\n", human) |
| 63 | fmt.Fprintf(&buf, "To: %s\r\n", to) |
| 64 | fmt.Fprintf(&buf, "Subject: %s\r\n", subject) |
| 65 | if replyToMsgID != "" { |
| 66 | fmt.Fprintf(&buf, "In-Reply-To: %s\r\n", replyToMsgID) |
| 67 | fmt.Fprintf(&buf, "References: %s\r\n", replyToMsgID) |
| 68 | } |
| 69 | buf.WriteString("\r\n") |
| 70 | buf.WriteString(body) |
| 71 | return []byte(buf.String()) |
| 72 | } |
| 73 | |
| 74 | // --- Flow 1: Human → Agent → Human -------------------------------------- |
| 75 |
no test coverage detected