Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ cd docker
echo 'MAIL_DOMAIN=chat.example.org' > .env
```

Optionally add a contact address for Let's Encrypt renewal notices:

```bash
echo 'ACME_EMAIL=admin@example.org' >> .env
```

The container generates a `chatmail.ini` with defaults from `MAIL_DOMAIN` on first start.
To customize chatmail settings, mount your own `chatmail.ini` instead
(see [Custom chatmail.ini](#custom-chatmailiini) below).
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ services:
max-file: "3"
environment:
MAIL_DOMAIN: $MAIL_DOMAIN
ACME_EMAIL: ${ACME_EMAIL:-}
network_mode: "host"
volumes:
## system (required)
Expand Down
1 change: 1 addition & 0 deletions env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
MAIL_DOMAIN=chat.example.com
# ACME_EMAIL=admin@example.com
7 changes: 7 additions & 0 deletions scripts/chatmail-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ if [ -n "${TLS_EXTERNAL_CERT_AND_KEY:-}" ]; then
fi
fi

# Inject ACME contact email from env var unless defined in chatmail.ini.
if [ -n "${ACME_EMAIL:-}" ]; then
if ! grep -q '^acme_email' "$CHATMAIL_INI"; then
echo "acme_email = $ACME_EMAIL" >> "$CHATMAIL_INI"
fi
fi

# Ensure mailboxes directory exists (chatmail-metadata needs it at startup,
# but Dovecot only creates it on first mail delivery)
mkdir -p "/home/vmail/mail/${MAIL_DOMAIN}"
Expand Down