A simple email server that allows you to create inboxes and rules to filter emails, written in Go.
- HTTP API for managing projects, inboxes, and rules
- SMTP server for receiving emails
- IMAP server for accessing emails
- Rule-based email filtering
- Configurable via YAML and environment variables
- Install dependencies:
make deps
- Start the development servers:
make dev # Starts PostgreSQL and Go server
make run-frontend # In another terminal, starts Vite dev server
Visit http://localhost:8080 for the API and http://localhost:5173 for the development frontend.
The application can be configured via:
- Environment variables (highest precedence)
- Configuration file
- Default values
Example configuration:
server:
http:
port: ":8080"
smtp:
port: ":1025"
hostname: "localhost"
imap:
port: ":1143"
hostname: "localhost"
database:
url: "postgres://inbox:inbox@localhost:5432/inbox451?sslmode=disable"
logging:
level: "info"
format: "json"
Create a Project:
curl -X POST http://localhost:8080/api/projects \
-H "Content-Type: application/json" \
-d '{"name": "Test Project"}'
Create an Inbox:
curl -X POST http://localhost:8080/api/projects/1/inboxes \
-H "Content-Type: application/json" \
-d '{"email": "[email protected]"}'
Create a Rule:
curl -X POST http://localhost:8080/api/projects/1/inboxes/1/rules \
-H "Content-Type: application/json" \
-d '{
"sender": "[email protected]",
"receiver": "[email protected]",
"subject": "Test Subject"
}'
Using SWAKS:
swaks --to [email protected] \
--from [email protected] \
--server localhost:1025 \
--header "Subject: Test Subject" \
--body "This is a test email."
.
├── cmd/ # Application entry points
├── frontend/ # Vue.js frontend application
├── internal/ # Internal packages
│ ├── api/ # HTTP API implementation
│ ├── core/ # Business logic
│ ├── smtp/ # SMTP server
│ ├── imap/ # IMAP server
│ ├── migrations/ # Database migrations
│ ├── storage/ # Database repositories
│ └── models/ # Database models
└── bruno/ # API test collections