MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / composeAgentOutbound

Function composeAgentOutbound

internal/relay/flow_test.go:47–55  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

45// reply: "{display} via e2a" <agent@send.e2a.dev> for From, agent's real
46// address for Reply-To.
47func 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.

Callers 3

TestFlow2_AgentAgentFunction · 0.85

Calls 1

ComposeMessageFunction · 0.92

Tested by

no test coverage detected