* create a wwwdev.sh entry point for developing the web part * rename script * fix README * add a note * don't depend on deltachat python package * avoid bailing out on jinja2 errors, and provide file-url for instant clickability * in webdev mode make page auto-refresh every 3 seconds
4.1 KiB
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
-
Prepare your local (presumably Linux) system:
scripts/init.sh
-
Setup a domain with
AandAAAArecords for your chatmail server. -
Set environment variable to the chatmail domain you want to setup:
export CHATMAIL_DOMAIN=c1.testrun.org # replace with your host
-
Fill in privacy contact data into the
chatmail.inifile -
Deploy the chat mail instance to your chatmail server:
scripts/deploy.sh
This script remotely sets up packages and configures the chatmail provider.
-
Run
scripts/generate-dns-zone.shand transfer the generated DNS records at your DNS provider
Home page and getting started for users
The deploy.sh script deploys
-
a default
index.htmlalong with a QR code that users can click to create accounts on your chatmail provider, -
a default
info.htmlthat is linked from the home page, -
a default
policy.htmlthat is linked from the home page.
All files are generated by the according markdown .md file in the www directory.
Refining the web pages
The scripts/webdev.sh script supports live development of the chatmail web presence:
scripts/init.sh # to locally initialize python virtual environments etc.
scripts/webdev.sh
-
uses the
www/src/page-layout.htmlfile for producing html documents fromwww/src/*.mdfiles. -
continously builds the web presence reading files from
www/srcdirectory and generating html files and copying assets to thewww/builddirectory. -
Starts a browser window automatically where you can "refresh" as needed.
Note that this script is not needed for running scripts/deploy.sh" which deploys the whole chatmail setup remotely. The code that generates the web pages is identical which means that webdev.sh` gives a pretty good preview.
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 /etc/chatmail-nocreate
While this file is present, account creation will be blocked.
Running tests and benchmarks (offline and online)
-
Set
CHATMAIL_SSHso thatssh root@$CHATMAIL_SSHallows to login to the chatmail instance server. -
To run local and online tests:
scripts/test.sh
-
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/doveauth.pyimplements 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.pyprevents unencrypted e-mail from leaving the chatmail instance and is integrated into postfix's outbound mail pipelines.