[WIP] Chatmail for OpenBSD
Go to file
2023-11-01 22:42:38 +01:00
.github/workflows run tests via scripts 2023-10-22 14:48:30 +02:00
chatmaild streamline account creation and add tests 2023-11-01 21:57:43 +01:00
deploy-chatmail simplify sysctl call 2023-10-31 22:03:03 +01:00
scripts fix benchmark script 2023-10-28 16:50:24 +02:00
tests streamline account creation and add tests 2023-11-01 21:57:43 +01:00
.gitignore Add scripts/generate-dns-zone.sh 2023-10-24 21:23:20 +00:00
plan.txt Allow to send securejoin 2023-10-16 21:15:56 +00:00
README.md streamline README, port some changes/additions from nine-branch 2023-11-01 22:42:38 +01:00

Chatmail instances optimized for Delta Chat apps

This repository helps to setup a ready-to-use chatmail instance comprised of a minimal setup of the battle-tested postfix smtp and dovecot imap services.

The setup is designed and optimized for providing chatmail accounts for use by Delta Chat apps.

Chatmail accounts are automatically created by a first login, after which the initially specified password is required for using them.

Getting Started deploying your own chatmail instance

  1. Prepare your local (presumably Linux) system:

    scripts/init.sh

  2. Setup a domain with A and AAAA records for your chatmail server.

  3. Set environment variable to the chatmail domain you want to setup:

    export CHATMAIL_DOMAIN=c1.testrun.org # replace with your host

  4. Deploy the chat mail instance to your chatmail server:

    scripts/deploy.sh

    This script uses pyinfra and ssh to setup packages and configure the chatmail instance on your remote server.

  5. Run scripts/generate-dns-zone.sh and transfer the generated DNS records at your DNS provider

  6. Start a Delta Chat app and create a new account by typing an e-mail address with an arbitrary username and @<your-chatmail-domain> appended. Use an at least 10-character random password.

Ports

Postfix listens on ports 25 (smtp) and 587 (submission) and 465 (submissions). Dovecot listens on ports 143(imap) and 993 (imaps).

Delta Chat will, however, discover all ports and configurations automatically by reading the autoconfig.xml file from the chatmail instance.

Emergency Commands to disable automatic account creation

If you need to stop account creation, e.g. because some script is wildly creating accounts, run:

touch /tmp/nocreate

While this file is present, account creation will be blocked.

Running tests and benchmarks (offline and online)

  1. Set CHATMAIL_SSH so that ssh root@$CHATMAIL_SSH allows to login to the chatmail instance server.

  2. To run local and online tests:

    scripts/test.sh

  3. To run benchmarks against your chatmail instance:

    scripts/bench.sh

Development Background for chatmail instances

This repository drives the development of "chatmail instances", comprised of minimal setups of

as well as two custom services that are integrated with these two:

  • chatmaild/src/chatmaild/dictproxy.py implements create-on-login account creation semantics and is used by Dovecot during login authentication and by Postfix which in turn uses Dovecot SASL to authenticate users to send mails for them.

  • chatmaild/src/chatmaild/filtermail.py prevents unencrypted e-mail from leaving the chatmail instance and is integrated into postfix's outbound mail pipelines.