Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| services:stalwart [2025/02/17 10:31] – willy | services:stalwart [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Stalwart Mail Server ====== | ||
| - | |||
| - | |||
| - | **work in progress** | ||
| - | |||
| - | [[https:// | ||
| - | |||
| - | I choose Stalwart because it's a new approach to serving mail. Instead of a bunch of interconnected tools, which are often a mess to setup, it's a one piece written from the ground up with a modern approach to email. | ||
| - | |||
| - | Please check [[selfhost: | ||
| - | |||
| - | ===== Installation ===== | ||
| - | |||
| - | Gentoo ships with a reasonably recent release of Stalwart, but i prefer to have finer control over it, so i prefer to install on bare-metal manually. The project also offer a bare-metal install approach which (see [[https:// | ||
| - | |||
| - | I have downloaded the script (and i suggest you do the same) and inspected it, so the following instructions are directly taken from the install script, but adapted to my setup. | ||
| - | |||
| - | **Note:** //we are installing on the external server, not on the home server!// | ||
| - | |||
| - | As usual, first of all create the user: | ||
| - | <code bash> | ||
| - | useradd -m stalwart | ||
| - | </ | ||
| - | |||
| - | Then download the latest release from [[https:// | ||
| - | <code bash> | ||
| - | su - stalwart | ||
| - | mkdir bin etc logs | ||
| - | chmod -R 755 / | ||
| - | wget ' | ||
| - | wget ' | ||
| - | cd bin | ||
| - | tar xvf ../ | ||
| - | tar xvf ../ | ||
| - | chmod +x stalwart-mail stalwart-cli | ||
| - | </ | ||
| - | |||
| - | Well, it's time to initialize Stalwart: | ||
| - | <code bash> | ||
| - | / | ||
| - | ✅ Configuration file written to / | ||
| - | 🔑 Your administrator account is ' | ||
| - | chmod 700 / | ||
| - | </ | ||
| - | Note the //chmod// to ensure the config file is not readable by anybody | ||
| - | |||
| - | |||
| - | Take note of the password! You will never see it again. | ||
| - | |||
| - | Now, start the server for the first time: | ||
| - | <code bash> | ||
| - | |||
| - | </ | ||
| - | |||
| - | Open up your browser and go to **http://< | ||
| - | |||
| - | ===== Configuration ===== | ||
| - | |||
| - | |||
| - | |||
| - | ===== AUtostart ===== | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | The below stuff is outdated | ||
| - | |||
| - | |||
| - | <code bash> | ||
| - | seradd -m -d / | ||
| - | mkdir / | ||
| - | chown stalwart: | ||
| - | </ | ||
| - | |||
| - | <file - docker-compose.yml> | ||
| - | name: stalwart | ||
| - | services: | ||
| - | mail-server: | ||
| - | tty: true | ||
| - | stdin_open: true | ||
| - | ports: | ||
| - | - 2443:443 | ||
| - | - 10025:125 # port 25 seems to create troubles in podman... | ||
| - | - 2080:8080 | ||
| - | - 2587:587 | ||
| - | - 2465:465 | ||
| - | - 2143:143 | ||
| - | - 2993:993 | ||
| - | - 4190:4190 | ||
| - | - 2110:110 | ||
| - | - 2995:995 | ||
| - | volumes: | ||
| - | - / | ||
| - | container_name: | ||
| - | image: stalwartlabs/ | ||
| - | networks: | ||
| - | - stalwart-net | ||
| - | |||
| - | networks: | ||
| - | stalwart-net: | ||
| - | </ | ||
| - | |||
| - | Note that i have used all ports above 1024 to avoid issues with root-only ports in rootless containers. | ||
| - | |||
| - | <code bash> | ||
| - | podman compose pull | ||
| - | podman compose up | ||
| - | </ | ||
| - | |||
| - | Note your admin usernamne and password like: | ||
| - | < | ||
| - | [mail-server] | 🔑 Your administrator account is ' | ||
| - | </ | ||
| - | |||
| - | Change the SMTP port to //125// to match the above compose file | ||
| - | |||
| - | |||
| - | ===== Configuration ===== | ||
| - | |||
| - | From the web UI. | ||
| - | |||
| - | Set hostname to your main email server. | ||
| - | |||
| - | Stop uneeded services. | ||
| - | |||
| - | Create domain. | ||
| - | |||
| - | Configure DNS properly | ||
| - | |||
| - | Create account. | ||
| - | |||
| - | Open ports from remote to local: | ||
| - | <code bash> | ||
| - | nft add rule wg prerouting iifname " | ||
| - | nft add rule wg prerouting iifname " | ||
| - | nft add rule wg prerouting iifname " | ||
| - | nft add rule wg prerouting iifname " | ||
| - | nft add rule wg prerouting iifname " | ||
| - | nft add rule wg prerouting iifname " | ||
| - | nft add rule wg prerouting iifname " | ||
| - | nft add rule wg prerouting iifname " | ||
| - | </ | ||
| - | |||
| - | Link certificates. Create a certificate in GUI with these values: | ||
| - | < | ||
| - | %{file:/ | ||
| - | %{file:/ | ||
| - | </ | ||
| - | and **copy** the certs from / | ||
| - | (create folder and make files readable!) | ||
| - | |||
| - | |||
| - | |||
| - | |||