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

Method writeProtectionEvents

internal/relay/screening.go:163–169  ·  view source on GitHub ↗

writeProtectionEvents appends the audit rows best-effort. Deterministic ids + ON CONFLICT DO NOTHING make an MTA-retried re-screen idempotent, so writing outside the message transaction is safe.

(ctx context.Context, messageID string, events []identity.ProtectionEvent)

Source from the content-addressed store, hash-verified

161// ON CONFLICT DO NOTHING make an MTA-retried re-screen idempotent, so writing
162// outside the message transaction is safe.
163func (s *Server) writeProtectionEvents(ctx context.Context, messageID string, events []identity.ProtectionEvent) {
164 for _, ev := range events {
165 if err := s.store.CreateProtectionEvent(ctx, ev); err != nil {
166 log.Printf("[mail:%s] screening_event write failed (%s/%s): %v", messageID, ev.Source, ev.Reason, err)
167 }
168 }
169}

Callers 1

deliverToAgentMethod · 0.45

Calls 1

CreateProtectionEventMethod · 0.80

Tested by

no test coverage detected