2023-10-12 15:06:48 +02:00
|
|
|
# Chat Mail server configuration
|
|
|
|
|
2023-10-17 00:21:32 +02:00
|
|
|
This repository setups a ready-to-go chatmail instance
|
|
|
|
comprised of a minimal setup of the battle-tested
|
|
|
|
[postfix smtp server](https://www.postfix.org) and [dovecot imap server](https://www.dovecot.org).
|
2023-10-12 15:06:48 +02:00
|
|
|
|
2023-10-13 16:14:11 +02:00
|
|
|
## Getting started
|
|
|
|
|
2023-10-17 00:21:32 +02:00
|
|
|
1. prepare your local system:
|
2023-10-13 16:14:11 +02:00
|
|
|
|
2023-10-17 00:21:32 +02:00
|
|
|
scripts/init.sh
|
2023-10-13 16:14:11 +02:00
|
|
|
|
2023-10-24 23:21:31 +02:00
|
|
|
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:
|
2023-10-13 16:14:11 +02:00
|
|
|
|
2023-10-17 00:21:32 +02:00
|
|
|
export CHATMAIL_DOMAIN=c1.testrun.org # replace with your host
|
2023-10-13 16:14:11 +02:00
|
|
|
|
2023-10-24 23:21:31 +02:00
|
|
|
4. run the deploy of the chat mail instance:
|
2023-10-13 15:36:42 +02:00
|
|
|
|
2023-10-17 00:21:32 +02:00
|
|
|
scripts/deploy.sh
|
2023-10-13 15:36:42 +02:00
|
|
|
|
2023-10-24 23:21:31 +02:00
|
|
|
5. run `scripts/generate-dns-zone.sh` and create the generated DNS records at your DNS provider
|
2023-10-13 17:45:54 +02:00
|
|
|
|
2023-10-17 00:21:32 +02:00
|
|
|
## Running tests and benchmarks (offline and online)
|
2023-10-13 17:45:54 +02:00
|
|
|
|
2023-10-17 00:21:32 +02:00
|
|
|
1. Set `CHATMAIL_SSH` so that `ssh root@$CHATMAIL_SSH` allows
|
|
|
|
to login to the chatmail instance server.
|
2023-10-14 11:34:09 +02:00
|
|
|
|
2023-10-17 00:21:32 +02:00
|
|
|
2. To run local and online tests:
|
2023-10-14 11:34:09 +02:00
|
|
|
|
2023-10-17 00:21:32 +02:00
|
|
|
scripts/test.sh
|
2023-10-14 11:34:09 +02:00
|
|
|
|
2023-10-17 00:21:32 +02:00
|
|
|
3. To run benchmarks against your chatmail instance:
|
2023-10-13 17:45:54 +02:00
|
|
|
|
2023-10-17 00:21:32 +02:00
|
|
|
scripts/bench.sh
|
2023-10-13 17:45:54 +02:00
|
|
|
|
2023-10-17 00:21:32 +02:00
|
|
|
## Running tests (offline and online)
|
2023-10-13 17:45:54 +02:00
|
|
|
|
2023-10-13 15:36:42 +02:00
|
|
|
```
|
2023-10-13 16:14:11 +02:00
|
|
|
## Dovecot/Postfix configuration
|
|
|
|
|
|
|
|
### Ports
|
2023-10-12 15:06:48 +02:00
|
|
|
|
|
|
|
Postfix listens on ports 25 (smtp) and 587 (submission) and 465 (submissions).
|
|
|
|
Dovecot listens on ports 143(imap) and 993 (imaps).
|
|
|
|
|
|
|
|
## DNS
|
|
|
|
|
2023-10-17 00:21:32 +02:00
|
|
|
For DKIM you must add a DNS entry as found in /etc/opendkim/selector.txt on your chatmail instance.
|
|
|
|
The above `scripts/deploy.sh` prints out the DKIM selector and DNS entry you
|
|
|
|
need to setup with your DNS provider.
|
2023-10-17 19:13:30 +02:00
|
|
|
|
|
|
|
## Emergency Commands
|
|
|
|
|
|
|
|
If you need to stop account creation,
|
|
|
|
e.g. because some script is wildly creating accounts,
|
|
|
|
just run `touch /tmp/nocreate`.
|
|
|
|
You can remove the file
|
|
|
|
as soon as the attacker was banned
|
|
|
|
by different means.
|
|
|
|
|