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

Function IsSelfSend

internal/loopback/loopback.go:50–58  ·  view source on GitHub ↗

IsSelfSend reports whether req targets only the sender's own inbox — i.e., the agent is writing a note to itself. Returns true only when there's a single To recipient that matches the agent's own address (case-insensitive, trimmed) AND no Cc/Bcc — any mixed/external recipient routes through normal S

(req outbound.SendRequest, agentEmail string)

Source from the content-addressed store, hash-verified

48// alias-strip downstream as a self-spam guard, so doing it here is
49// purely "see through" the aliases earlier.
50func IsSelfSend(req outbound.SendRequest, agentEmail string) bool {
51 if len(req.CC) != 0 || len(req.BCC) != 0 {
52 return false
53 }
54 if len(req.To) != 1 {
55 return false
56 }
57 return strings.EqualFold(strings.TrimSpace(req.To[0]), agentEmail)
58}
59
60// StripAgentSelfAliases removes case-insensitive, whitespace-trimmed
61// matches of agentEmail from addrs. Used to pre-clean reply recipients

Callers 2

autoApproveMethod · 0.92
isSelfSendFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected