Glacem

Documentation

Glacem

Transactional email through your own SMTP relay.

Glacem gives your application one HTTP endpoint to send transactional email. It queues each message, delivers it through the SMTP relay you configure, and retries on temporary failures.

Messages can render stored templates with per-send variables. A delivery-event stream reports accepted, delivered, and bounced states, so you don't have to read mail server logs.

#Installation

Glacem ships as one static binary. Place it on your host and start it:

# download and start
$ curl -sSL get.api.stanislav.net/install | sh
$ glacem serve --data /var/lib/glacem
→ listening on :2500 · api ready
By default Glacem binds to 127.0.0.1:2500. Put it behind your own reverse proxy to expose it over TLS.

#Quickstart

# send a message
$ curl -X POST :2500/v1/send \
    -d '{"to":"a@b.c","subject":"Hi"}'
→ queued · id msg_7

# stream delivery events
$ curl :2500/v1/events
{"id":"msg_7","state":"delivered"}

#Configuration

Configure with flags, environment variables, or a small YAML file. Flags take precedence.

# glacem.yaml
data:    /var/lib/glacem
listen:  127.0.0.1:2500
log:     info
smtp:
  host: smtp.internal
  port: 587

#API reference

Every route lives under /v1. Requests without a valid token return 401.

Method & pathDescription
POST /v1/sendQueue a message for delivery.
GET /v1/messages/{id}Check a message's status.
GET /v1/eventsStream delivery events.
PUT /v1/templates/{name}Create or update a template.
GET /healthLiveness probe. Returns 200 when ready.

#CLI

The glacem binary is both the server and the client.

CommandDescription
glacem serveStart the sender.
glacem send <to>Send a test message.
glacem templates lsList templates.
glacem statusShow queue depth and delivery rate.