Many software systems rely on being able to send automated emails. Examples include cron, windmill.dev and so on.
Unfortunately, the rise of spam has made simple unauthenticated SMTP a thing of the past, and self-hosting email is becoming increasingly difficult and time-consuming. GMail is also unusable for large mailboxes, operations like deleting large amounts of bulk emails are painfully slow if they even complete without generating errors.
Mailsink is a server that is configured as a relayhost. All emails get saved to a SQLite database, and it has a web server to see the emails and search them.
This is a simple search facility . It uses SQLite's FTS5 full-text search engine, albeit with a search syntax for phrases, negation and boolean queries inspired by Google's original syntax rather than FTS5's idiosyncratic one.
The SQLite file format is portable across OS and architectures. You could build an index on a Mac and deploy to a Linux server. https://www.sqlite.org/aff_short.html
This server lacks any authentication and is meant to be used on an Intranet to handle non-sensitive emails, the kind programmatically generated by software like cron jobs.
For a more full-featured solution, have a look at MailPit.
To build mailsync
from source, run make
in this directory.
copy bin/fts5index
somewhere in your $PATH
.
You cannot simply use go build
because go-sqlite3 requires build tags to
include the fts5 extension.
host$ ./mailsink -h
Usage of ./mailsink:
-db string
SQLite database path (default "mailsink.db")
-http string
HTTP server address (default "127.0.0.1:8080")
-smtp string
SMTP server address (default "127.0.0.1:2525")
If you prefer Docker, just type make docker
and it will build the container
image, then run it using the default ports, with the SQLite saved to a volume
so it survives restarts.