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)
| 48 | // alias-strip downstream as a self-spam guard, so doing it here is |
| 49 | // purely "see through" the aliases earlier. |
| 50 | func 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 |
no outgoing calls
no test coverage detected