Hyvor Relay is an open-source, self-hosted email API designed for developers who need full control over their email infrastructure. It eliminates vendor lock-in by letting you send emails via SMTP using your own servers while automating critical deliverability tasks like DNS record management, bounce handling, and IP reputation monitoring. Built for scalability, it supports multi-tenancy, project isolation, and horizontal scaling via Docker Swarm.
The system is architected with PHP/Symfony for the API backend, Go for email workers and DNS services, and SvelteKit for the frontend. It uses PostgreSQL for both database and queue storage, with native Prometheus metrics and Grafana dashboards for observability. Deployment is simplified via Docker Compose or Swarm, making it ideal for DevOps teams managing high-volume transactional or marketing email workloads.
What You Get
- Email API - Send emails via a clean, idempotent REST API supporting HTML/plain text, attachments, custom headers, and multiple recipients.
- DNS Automation - Built-in DNS server automatically manages MX, SPF, DKIM, and reverse DNS records without manual configuration.
- Multi-Tenancy & Project Management - Isolate workloads across multiple tenants and projects, each with independent domains, API keys, and webhooks.
- Email Logs & SMTP Conversations - View full delivery logs, headers, and SMTP session traces with 30-day retention for debugging and compliance.
- Bounce & Suppression Handling - Automatically detect and suppress bounced emails and unsubscribe requests to protect sender reputation.
- Webhooks for Events - Receive real-time HTTP callbacks for deliveries, bounces, complaints, domain verifications, and more.
- Prometheus & Grafana Integration - Native observability with pre-built dashboards for monitoring email throughput, queue depth, and server health.
- Queue Isolation - Separate transactional and bulk email queues to prevent reputation contamination between different email types.
- Health Checks - Automated monitoring for DNS errors, IP reputation drops, and server failures with instant alerts.
- Scalability via Docker Swarm - Horizontally scale across multiple servers and IP addresses to handle millions of daily emails.
Common Use Cases
- Running a SaaS platform with transactional emails - A SaaS company uses Hyvor Relay to send password resets and notifications without relying on third-party APIs, ensuring data privacy and predictable costs.
- Managing email for multiple clients as an agency - A digital agency hosts Hyvor Relay to serve distinct clients under separate tenants, each with their own domains and branding, while maintaining centralized admin control.
- High-volume marketing campaigns with deliverability needs - An e-commerce brand sends 500K+ emails monthly using dedicated IPs and queue isolation to maintain inbox placement and avoid spam filters.
- Developers needing full control over email infrastructure - A startup deploys Hyvor Relay on-premises to comply with data sovereignty laws, using the open-source AGPL version to inspect and modify the codebase.
Under The Hood
Architecture
- Clear multi-service architecture with distinct frontend, backend, and worker containers, enforcing separation of concerns through container boundaries
- Backend leverages FrankenPHP with Symfony, using dependency injection and configuration-driven service registration for maintainable enterprise-grade structure
- Worker service implemented in Go handles SMTP relay logic with explicit environment variables and port mapping, ensuring domain-specific isolation
- Multi-stage Docker builds minimize production image size and attack surface while preserving build-time dependencies
- Frontend and backend are decoupled via HTTP API boundaries, with Traefik routing traffic based on Host and PathPrefix rules to enforce clean contract boundaries
Tech Stack
- Svelte and Vite-based frontend with TypeScript, built using @sveltejs/kit and deployed via Docker multi-stage builds
- Backend powered by FrankenPHP with Symfony components, running on PHP 8.4 with Composer-managed dependencies and Caddy as the web server
- Go-based worker service compiled from Go 1.25.4, deployed as a native binary for performance and simplicity
- Multi-stage Dockerfile orchestrates all services with environment-specific configurations for development and production
- Traefik reverse proxy routes traffic with TLS termination and middleware support, using Docker labels for dynamic configuration
- Infrastructure defined via compose.yaml with shared network, SMTP simulator, and volume mounts enabling live development reloads
Code Quality
- Extensive test suite covering unit, integration, and end-to-end scenarios with clear layer separation
- Consistent use of deterministic test factories for readable and maintainable test data setup
- Comprehensive coverage of business logic with targeted assertions on response structure, data integrity, and edge cases
- Strong type safety through explicit return types, DTOs, and enums, ensuring robustness across the codebase
- Robust error handling with standardized HTTP status codes and structured JSON responses, though custom exception classes are absent
- Well-organized test modules mirroring application structure, supported by automated CI/CD pipelines
What Makes It Unique
- Native observability layer with server-aware metrics exposed directly in the UI, enabling real-time diagnostics without external tools
- Unified email delivery pipeline with integrated DNS query tracking and webhook analytics in the same interface as email sends
- Svelte-based reactive stores with derived state eliminate boilerplate while preserving type safety across console views
- Client-side recipient list expansion with intelligent lazy-rendering and visual gradient masking for performance on large datasets
- Seamless console-to-backend metric correlation through shared schema definitions, allowing dynamic frontend adaptation without API version coupling
- Customizable email send row UI with embedded status indicators and context-aware actions, reducing navigation depth while preserving rich data visualization