User Tools

Site Tools


computing:chatmail

  • chatmail
  • Jonathan Haack
  • Haack's Networking
  • webmaster@haacksnetworking.org

chatmail


This tutorial contains my setup notes for creating my chatmail instance.

Set up Debian 12 machine and a dedicated non-root user that will ssh into the root user and deploy the instance. Exchange keys etc., and make sure to use a ed25519 key. Once that's done, setup all DNS before starting and make sure all required packages are installed:

sudo apt install git rsync python3-venv python3-dev gcc libcrypt-dev

Make sure the following DNS records are established to begin with:

  • A
  • AAAA
  • MX

Then, as worker

ssh-keygen -t ed25519 -C "worker@$(hostname)" -f ~/.ssh/id_ed25519
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_ed25519

Let's now create a config file for ssh so we don't go out and back in but instead ssh directly into localhost:

su - worker
nano ~/.ssh/config

Inside that, put the following:

Host mail.haacknet.org
HostName 127.0.0.1
User root
IdentityFile ~/.ssh/id_ed25519
IdentitiesOnly yes

When exchanging keys, you will need to use the -f flag. Okay, now let's set perms and start configuring the instance.

chmod 600 ~/.ssh/config
git clone https://github.com/chatmail/chatmail.git
cd ~/relay
scripts/initenv.sh
scripts/cmdeploy status
mkdir -p ~/Repositories
cd ~/Repositories
git clone https://github.com/chatmail/relay
cd relay
scripts/initenv.sh
scripts/cmdeploy init mail.haacknet.org

This creates chatmail.ini for you so that when you run cmdeploy it knows where to ssh and which instance to control, etc. Now, we setup the instance:

scripts/cmdeploy run

I had to run this twice. The second time it created the LE records. After that, run its DNS checker and then create all the records it requests

su - worker
cd ~/Repositories/relay
scripts/cmdeploy dns

After setup, run the status and test commands to check everything:

su - worker
cd ~/Repositories/relay
scripts/cmdeploy status
scripts/cmdeploy test

To upgrade (in progress), probably:

cd ~/Repositories/relay
git pull origin main --rebase --autostash
scripts/initenv.sh
scripts/cmdeploy run

You can see new accounts here:

find /home/vmail/mail/mail.haacknet.org -mindepth 1 -maxdepth 1 -type d

If a flood of new accounts comes in and/or you suspect bots, then disable public reg:

touch /etc/chatmail-nocreate

The primary page I used for setup was here:

oemb1905 2026/09/08 02:12

computing/chatmail.txt · Last modified: by oemb1905