A very simple SMTP server with a REST API

build status Go Report Card

A server that accepts smtp request and saves the emails in memory for later retrieval.


usage: gosmtpd [<flags>]

  --help                  Show context-sensitive help (also try --help-long and --help-man).
  --webport="8000"        Port the web server should run on
  --hostname="localhost"  Hostname for the smtp server to listen to
  --port="2525"           Port for the smtp server to listen to
  --forwardhost=""        The hostname after the @ that we should forward i.e.
  --forwardsmtp=""        SMTP server to forward the mail to
  --forwardport="25"      The port on which email should be forwarded
  --forwarduser=""        The username for the forward host
  --forwardpassword=""    Password for the user
  --mailexpiration=300    Time in seconds for a mail to expire, and be removed from database
  --version               Show application version.

GET /status

Returns a 200 if the service is up

GET /inbox

List all emails in the system

GET /inbox/:email

List all email for a given email address

GET /inbox/:email/:id

Get a specific email by id

GET /inbox/:email/listen

Creates a Websocket connection, that can be used for listing to updates on the email account

DELETE /inbox/:email

Delete all mails for a given email

DELETE /inbox/:email/:id

Delete a email via the id

Trying it out

You can install it by doing

docker push

docker start

Expand ▾ Collapse ▴


The Go Gopher

There is no documentation for this package.