Skip to content

feat(spfd): add a local gRPC SPF evaluation service - #60

Open
zaccone wants to merge 5 commits into
masterfrom
grpc-layer
Open

zaccone wants to merge 5 commits into
masterfrom
grpc-layer

Conversation

@zaccone

@zaccone zaccone commented Sep 17, 2026

Copy link
Copy Markdown
Owner

Summary

Add spfd grpc so local applications can evaluate SPF through the versioned unary spf.v1.SPFService/Check API. Postfix and gRPC run as separate processes using the same executable. SPF outcomes, including fail/temperror/permerror, are returned as typed results; malformed requests, overload, and caller cancellation use gRPC status codes.

The implementation includes shared identity handling, bounded evaluations and connections, caller/server deadlines, standard health RPCs, and graceful shutdown with forced closure of unfinished HTTP/2 handshakes. It also adds pinned protobuf generation with a CI drift check, a Go client example, an independent systemd unit, and a deterministic binary smoke test.

Review sequence

  1. 520f249: API contract and generated bindings.
  2. 881f8de: Shared identity helpers; preserve existing CLI/Postfix behavior.
  3. dfc4068: Evaluation adapter, validation, and result mapping.
  4. 74bda02: Runnable server, limits, health, and shutdown tests.
  5. fcfc8f9: Deployment, documentation, client example, and smoke test.

Validation

  • go test ./...
  • go test -race -count=1 -timeout=60s ./...
  • go vet ./..., go mod verify, and go mod tidy -diff
  • Protobuf regeneration produces no diff.
  • Existing Postfix and new gRPC binary smoke tests pass against local DNS fixtures.
  • govulncheck v1.8.0: no vulnerabilities found.

Linux systemd validation is configured in CI; it was not run on the macOS development host.

Deployment scope

The initial endpoint accepts loopback TCP or Unix sockets only and has no TLS/client authentication. Mail acceptance policy remains with the caller. Existing Postfix deployment configuration is preserved. Existing benchmark reports do not establish gRPC capacity. See deploy/GRPC.md and api/spf/v1/README.md for usage and contract details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant