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

Function recipientCountError

internal/httpapi/outbound.go:80–91  ·  view source on GitHub ↗

recipientCountError returns a too_many_recipients envelope when the combined to+cc+bcc count exceeds maxRecipients, else nil.

(groups ...[]string)

Source from the content-addressed store, hash-verified

78// recipientCountError returns a too_many_recipients envelope when the combined
79// to+cc+bcc count exceeds maxRecipients, else nil.
80func recipientCountError(groups ...[]string) *ErrorEnvelope {
81 total := 0
82 for _, g := range groups {
83 total += len(g)
84 }
85 if total > maxRecipients {
86 return NewError(http.StatusBadRequest, "too_many_recipients",
87 "too many recipients — at most 50 across to, cc and bcc combined").
88 WithDetails(map[string]any{"max_recipients": maxRecipients, "provided": total})
89 }
90 return nil
91}
92
93// SendEmailRequest is the new-thread send body. to/subject/body are required
94// (MSG-3): RFC 5321 requires ≥1 recipient (From/Date are server-set), and a

Callers 3

handleReplyMethod · 0.85
handleForwardMethod · 0.85
validateOutboundBodyMethod · 0.85

Calls 2

NewErrorFunction · 0.85
WithDetailsMethod · 0.80

Tested by

no test coverage detected