all repos — postern

@ 0c62cb9eb1848e5d4ab12ede27ed1b3b70f586f2

Modern mail management

clone
git clone https:///postern.git

Readme.md (view raw)

  1Postern
  2=======
  3
  4Subscribe to our mailing list by sending an email to `postern+subscribe@lists.p25.dev` for announcements of
  5new versions.
  6The mailing list server runs Postern and mlmmj.
  7
  8Postern is a modern all-in-one mail delivery agent. It combines IMAP (IMAP4rev2),
  9SMTP Submission and SMTP delivery.
 10
 11We have EU Sovereignity at our core values. We welcome users and contributions from around the world and will keep
 12service providers such as server hosting and DNS registrars EU based.
 13
 14> **⚠️ WARNING:** This software is in an experimental state.
 15> Do not use in production or for any important emails while we work towards v1.0.
 16
 17Overview
 18--------
 19
 20What makes Postern special is its policy engine. Imagine it as a modern Sieve based on
 21[Starlark](https://starlark-lang.org), which uses Python syntax.
 22The [policy.star file](https://code.raphting.dev/postern.git/blob/main/policy.star) has an example how new senders end up in a "Gatekeeper" mailbox.
 23Simply moving a message from one folder to another updates how the policy engine reacts to this sender
 24for future messages.
 25
 26Reacting on side effects such as database state or network calls is probably the biggest advantage of the policy engine
 27over Sieve when it comes to modern email management.
 28
 29Postern has secure defaults, stores emails encrypted at rest and runs as a single binary with an SQLite backend.
 30This simplifies backups. All you need to back up is your `/var/lib/postern` (depending on your configuration) directory.
 31
 32You can subscribe to *announcements* by sending an email to `postern+subscribe@lists.p25.dev`.
 33The mailing list server runs on Postern and mlmmj.
 34
 35Architecture
 36------------
 37
 38Postern was developed for easy email self-hosting while not fighting email deliverability or a multitude of DNS records.
 39
 40Postern is designed to sit behind an email relay and MX backup like [p25.dev](https://p25.dev). With just 3 DNS records
 41(DKIM, MX and domain verification) you are ready for sending and receiving emails. Postern can run behind other services
 42such as Postfix too, as it is fully standards compliant. The main use case will be the operation 
 43behind [p25.dev](https://p25.dev) though just for its simplicity and to support more inexperienced admins in self-hosting
 44email.
 45
 46Your emails are stored encrypted in [Data At Rest Encryption (DARE) format](https://github.com/minio/sio).
 47Note that the SQLite database stores email _metadata_ such as To and From addresses and Subjects
 48in **plain text** to support fast IMAP search requests.
 49
 50All networking is secure by default. IMAP and SMTP Submission run on implicit TLS. SMTP Delivery requires
 51STARTTLS and authentication. Passwords are generated by Postern to avoid weak choices.
 52
 53DKIM key management is designed for easy key rotation.
 54
 55Quickstart
 56----------
 57
 58Postern is in alpha state. You might experience some trial and error to arrive at a working solution.
 59This quickstart tutorial assumes you work on a modern Linux installation.
 60Because you read this Readme, it looks like you have access to the rest of the source code and can compile it with
 61`go build -o postern .`.
 62
 631. Install the `postern.service` file under `/etc/systemd/system/postern.service`.
 642. Place `policy.star` under `/etc/postern/policy.star` and adjust to your requirements.
 653. For secure storage of the masterkey,
 66   run `systemd-ask-password -n | systemd-creds encrypt - /etc/credstore/masterkey`
 674. Retrieve a TLS certificate, for example with [acme.sh](https://github.com/acmesh-official/acme.sh).
 68   Make sure the systemd service can access the certificates (`/etc/postern/`).
 695. Enable and start Postern `systemctl enable postern` and `systemctl start postern`
 706. Use the Postern CLI to add configuration. Based on the systemd integration, this is admittedly clunky
 71   and will be improved soon.
 72
 73```Shell
 74# The masterkey file is only decrypted with a running postern service and only accessible by root.
 75# (this needs to be changed soon)
 76CONFIGURATION_DIRECTORY=/etc/postern POSTERN_PERSISTENCE_DIR=/var/lib/postern POSTERN_MASTERKEY_FILE=/run/credentials/postern.service/masterkey /usr/local/bin/postern
 77```
 78
 79You will need to create a user, a backup-mx user for email delivery and a DKIM key.
 80
 81```Shell
 82postern user add testuser
 83postern user add-address testuser user@example.com
 84postern backup-mx add p25dev
 85postern dkim add selector example.com # Don't forget to enable the key with 'dkim enable selector example.com'
 86```
 87
 88If you want a smooth start for sending and receiving emails, make an account at [p25.dev](https://p25.dev) to integrate
 89Postern with it.
 90
 91Contributing via Mailing List
 92-----------------------------
 93
 94We manage development via plain-text email patches rather than web-based pull requests.
 95
 96**Mailing list:** `postern-dev@lists.p25.dev` (subscribe with an email to `postern-dev+subscribe@lists.p25.dev`)
 97
 98Use `git send-email` to contribute your patch. For a tutorial see [https://git-send-email.io](https://git-send-email.io/).
 99It is okay to use the mailing list as a chat rather than a formalized procedure. Just say 'hi'!
100
101> **💡 TIP:** You can integrate `git send-email` with Postern too!
102
103Security
104--------
105
106Please do not disclose security vulnerabilities via the public mailing list.
107Instead, use `https://p25.dev/.well-known/security.txt`