Skip to content

A simple email server that allows you to create inboxes and rules to filter emails, written in Go.

License

Notifications You must be signed in to change notification settings

inbox451/inbox451

Repository files navigation

Inbox451 Logo

Inbox451

A simple email server that allows you to create inboxes and rules to filter emails, written in Go.

Go Report Card Build Status codecov License

Features

  • 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

Quick Start

  1. Install dependencies:
make deps
  1. 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.

Configuration

The application can be configured via:

  1. Environment variables (highest precedence)
  2. Configuration file
  3. 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"

API Examples

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"
  }'

Testing Email Reception

Using SWAKS:

swaks --to [email protected] \
      --from [email protected] \
      --server localhost:1025 \
      --header "Subject: Test Subject" \
      --body "This is a test email."

Project Structure

.
├── 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

Documentation

License

MIT

About

A simple email server that allows you to create inboxes and rules to filter emails, written in Go.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published