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

Function BuildForwardSubject

internal/outbound/forward.go:184–194  ·  view source on GitHub ↗

BuildForwardSubject prefixes "Fwd: " unless the subject already starts with Fwd:, Fw:, or Re:. The dedup avoids stacking on chains. Empty inputs produce "Fwd: (no subject)" so the recipient still sees the message is a forward.

(orig string)

Source from the content-addressed store, hash-verified

182// inputs produce "Fwd: (no subject)" so the recipient still sees the
183// message is a forward.
184func BuildForwardSubject(orig string) string {
185 trimmed := strings.TrimSpace(orig)
186 if trimmed == "" {
187 return "Fwd: (no subject)"
188 }
189 lower := strings.ToLower(trimmed)
190 if strings.HasPrefix(lower, "fwd:") || strings.HasPrefix(lower, "fw:") {
191 return trimmed
192 }
193 return "Fwd: " + trimmed
194}
195
196// BuildForwardBody composes the text/plain body of a forward: the
197// caller's optional comment, a Gmail-style divider, the original headers

Callers 2

handleForwardMethod · 0.92
TestBuildForwardSubjectFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestBuildForwardSubjectFunction · 0.68