composeAgentOutbound mirrors what sender.go does for a real agent send or reply: "{display} via e2a" for From, agent's real address for Reply-To.
(t *testing.T, agentAddr string, to []string, subject, body, replyToMsgID, conversationID string)
| 45 | // reply: "{display} via e2a" <agent@send.e2a.dev> for From, agent's real |
| 46 | // address for Reply-To. |
| 47 | func composeAgentOutbound(t *testing.T, agentAddr string, to []string, subject, body, replyToMsgID, conversationID string) []byte { |
| 48 | t.Helper() |
| 49 | headerFrom := fmt.Sprintf("%q <%s>", agentAddr+" via e2a", platformFrom) |
| 50 | raw, err := outbound.ComposeMessage(headerFrom, to, nil, subject, body, "text/plain", replyToMsgID, nil, relayFromDomain, agentAddr, conversationID) |
| 51 | if err != nil { |
| 52 | t.Fatalf("compose: %v", err) |
| 53 | } |
| 54 | return raw |
| 55 | } |
| 56 | |
| 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. |
no test coverage detected