email-queue
443
A lightweight, self-hosted email queue service built with Go. Queue emails via REST API and let the background worker handle SMTP delivery with automatic retry tracking.
X-API-Key headerdebian:bookworm-slimdocker run -d \
--name email-queue \
-p 3000:3000 \
-e SERVER_PORT=3000 \
-e API_KEY=your-secret-key \
-e DATABASE_PROVIDER=sqlite \
-e DATABASE_NAME=data \
-e [email protected] \
-e EMAIL_FROM_NAME="My App" \
-e EMAIL_PASSWORD=your-email-password \
-e EMAIL_SMTP_HOST=smtp.example.com \
-e EMAIL_SMTP_PORT=587 \
-e DELAY_SECOND=5 \
jefriherditriyanto/email-queue:latest
version: "3.8"
services:
email-queue:
image: jefriherditriyanto/email-queue:latest
ports:
- "3000:3000"
environment:
SERVER_PORT: 3000
API_KEY: your-secret-key
DATABASE_PROVIDER: sqlite
DATABASE_NAME: data
EMAIL_FROM_EMAIL: [email protected]
EMAIL_FROM_NAME: My App
EMAIL_PASSWORD: your-email-password
EMAIL_SMTP_HOST: smtp.example.com
EMAIL_SMTP_PORT: 587
DELAY_SECOND: 5
volumes:
- email-data:/app
volumes:
email-data:
| Variable | Description | Default |
|---|---|---|
SERVER_PORT | Server port | 3000 |
API_KEY | API key for authentication | test-key |
DATABASE_PROVIDER | Database engine (sqlite, mysql, postgres) | sqlite |
DATABASE_HOST | Database host | localhost |
DATABASE_PORT | Database port | auto |
DATABASE_USER | Database username | — |
DATABASE_PASS | Database password | — |
DATABASE_NAME | Database name / file path | ./data.sqlite |
EMAIL_FROM_EMAIL | Sender email address | — |
EMAIL_FROM_NAME | Sender display name | — |
EMAIL_PASSWORD | SMTP password | — |
EMAIL_SMTP_HOST | SMTP server host | — |
EMAIL_SMTP_PORT | SMTP server port | — |
DELAY_SECOND | Worker polling interval (seconds) | 5 |
All endpoints require the X-API-Key header.
POST /api/message/send
Request Body:
{
"to": "[email protected]",
"subject": "Hello",
"body": "<h1>Hello World</h1>"
}
Response 201:
{
"status": 201,
"message": "Email queued successfully",
"data": {
"key": "dfc9e68f-9faf-4d21-9ebc-84b92d7183fd"
}
}
GET /api/message/status/:key
Response 200:
{
"status": 200,
"message": "Email status retrieved",
"data": {
"key": "dfc9e68f-9faf-4d21-9ebc-84b92d7183fd",
"is_sended": true,
"is_error": false,
"error_message": "",
"sended_at": "2026-03-31T15:00:05Z"
}
}
POST /api/message/send request with email detailsis_sended: falsekey is returned for status trackingDELAY_SECOND secondsis_sended is set to trueis_error is set to true with error_message detailsGET /api/message/status/:keyMIT
Content type
Image
Digest
sha256:f331e9284…
Size
49.3 MB
Last updated
30 days ago
docker pull jefriherditriyanto/email-queue