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

Method signMessage

internal/outbound/sender.go:315–333  ·  view source on GitHub ↗

signMessage looks up a DKIM keypair for the given domain and returns a signed copy of the message. Returns (nil, false) when no key is stored for the domain or when signing fails — callers proceed with the unsigned message rather than failing the send.

(message []byte, domain string)

Source from the content-addressed store, hash-verified

313// stored for the domain or when signing fails — callers proceed with
314// the unsigned message rather than failing the send.
315func (s *Sender) signMessage(message []byte, domain string) ([]byte, bool) {
316 if s.dkimLookup == nil || domain == "" {
317 return nil, false
318 }
319 selector, privKey, err := s.dkimLookup.GetDKIMKeyInternal(context.Background(), domain)
320 if err != nil {
321 log.Printf("[sender] dkim key lookup for %s: %v", domain, err)
322 return nil, false
323 }
324 if selector == "" || len(privKey) == 0 {
325 return nil, false
326 }
327 signed, err := dkim.Sign(message, domain, selector, privKey)
328 if err != nil {
329 log.Printf("[sender] dkim sign for %s failed (sending unsigned): %v", domain, err)
330 return nil, false
331 }
332 return signed, true
333}
334
335// normalizeAddrs parses and lowercases a list of email addresses.
336// Returns an error if any address is unparseable.

Calls 2

SignFunction · 0.92
GetDKIMKeyInternalMethod · 0.65