How samirkoirala/ownsmtp works
OwnSMTP is a self-hosted HTTP gateway that accepts authenticated email requests, validates them, and relays them through a configured SMTP account. The main flow is HTTP client → FastAPI routes → API-key check and request validation → SMTP delivery → success or HTTP error. Readiness checks configuration without contacting SMTP. The source shows these runtime interactions; deployment files and tests are excluded.
Main entry points: api.py API routes · mailer.py SMTP mailer · config.py Runtime settings · app.py FastAPI app
Components 9
HTTP runtime
- FastAPI app
email_gateway/app.py - API routes
email_gateway/api.py
Access and settings
- API-key check
email_gateway/security.py - Runtime settings
email_gateway/config.py
Email delivery
- Email contracts
email_gateway/schemas.py - SMTP mailer
email_gateway/mailer.py
External systems
- Environment
- SMTP server
Other components
- HTTP client
Connections 13
- HTTP client → FastAPI app: sends HTTP
- FastAPI app → API routes: dispatches routes
- API routes → API-key check: checks key
- API-key check → Runtime settings: loads settings
- API routes → Runtime settings: checks readiness
- Runtime settings → Environment: reads variables
- API routes → Email contracts: validates and responds
- API routes → SMTP mailer: requests delivery
- SMTP mailer → Runtime settings: reads SMTP settings
- SMTP mailer → Email contracts: reads email request
- SMTP mailer → SMTP server: sends message
- SMTP server → SMTP mailer: accepts or refuses
- API routes → HTTP client: returns HTTP result