Commits vergleichen

..

2 Commits

Autor SHA1 Nachricht Datum
DerLinkman
1fe8ff3c4f Restructuring of Docs Layout 2023-05-25 12:08:41 +02:00
DerLinkman
7c1ba98e3f Rewamped Index page 2023-05-25 11:26:30 +02:00
61 geänderte Dateien mit 1444 neuen und 2120 gelöschten Zeilen

Datei anzeigen

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 📥
uses: actions/checkout@v3.5.3
uses: actions/checkout@v3.5.2
with:
token: '${{ secrets.GHPAGES_ACTION_CHECKOUT_TOKEN_PAT }}'
fetch-depth: '0' # https://github.com/timvink/mkdocs-git-revision-date-localized-plugin#note-when-using-build-environments
@ -30,7 +30,7 @@ jobs:
bash .github/workflows/fix_redirects.sh
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.4.2
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
token: '${{ secrets.GHPAGES_ACTION_DEPLOY_TOKEN_PAT }}'
git-config-name: '${{ secrets.GHPAGES_ACTION_DEPLOY_GITNAME_PAT }}'

Datei anzeigen

@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout 📥
uses: actions/checkout@v3.5.3
uses: actions/checkout@v3.5.2
with:
token: '${{ secrets.GHPAGES_ACTION_CHECKOUT_TOKEN_PAT }}'
fetch-depth: '0' # https://github.com/timvink/mkdocs-git-revision-date-localized-plugin#note-when-using-build-environments

Datei anzeigen

@ -68,7 +68,7 @@ Das folgende Skript kann in `/etc/cron.daily/mailcow-backup` platziert werden -
#!/bin/sh
# Backup mailcow data
# https://mailcow.github.io/mailcow-dockerized-docs/b_n_r_backup/
# https://mailcow.github.io/mailcow-dockerized-docs/b_r_m_backup/
set -e

Datei anzeigen

@ -68,7 +68,7 @@ This following script may be placed in `/etc/cron.daily/mailcow-backup` - do not
#!/bin/sh
# Backup mailcow data
# https://mailcow.github.io/mailcow-dockerized-docs/backup_restore/b_n_r-backup/
# https://mailcow.github.io/mailcow-dockerized-docs/backup_restore_migrate/b_r_m-backup/
set -e

Datei anzeigen

@ -0,0 +1,179 @@
## ...innerhalb desselben Systemtyps (x86 auf x86, ARM64 auf ARM64 usw.)
!!! warning "Warnung"
Diese Anleitung geht davon aus, dass Sie einen bestehenden mailcow-Server (Quelle) auf einen neuen, leeren Server (Ziel) migrieren wollen. Seien Sie sich bewusst, dass, wenn Sie dieser Anleitung folgen, **ALLE** Docker Volumes (standardmäßig `/var/lib/docker/volumes`) und somit alle Daten in diesen Volumes gelöscht werden.
!!! tip "Tipp"
Alternativ können Sie das Skript `./helper-scripts/backup_and_restore.sh` verwenden, um ein vollständiges Backup auf der Quellmaschine zu erstellen, dann installieren Sie mailcow auf der Zielmaschine wie gewohnt, kopieren Sie Ihre `mailcow.conf` (aus dem Backup Ordner) und verwenden das gleiche Skript, um Ihr Backup auf der Zielmaschine wiederherzustellen.
**1\.**
Befolgen Sie die [Installationsanleitung](../getting-started/i_u_m_install.de.md) von Docker und Compose.
**2\.** Stoppen Sie Docker und stellen Sie sicher, dass Docker gestoppt wurde:
```
systemctl stop docker.service
systemctl status docker.service
```
**3\.** Führen Sie die folgenden Befehle auf dem Quellcomputer aus (achten Sie darauf, die Schrägstriche am Ende des ersten Pfadparameters wie unten gezeigt hinzuzufügen).
!!! danger "Vorsicht"
Dieser Befehl (der Zweite) löscht alles, was sich bereits unter `/var/lib/docker/volumes` auf dem Zielserver befindet. Stellen Sie also sicher, dass sich nichts Wichtiges mehr auf dem Zielserver befindet, bevor Sie die folgenden Befehle ausführen!
```
rsync -aHhP --numeric-ids --delete /opt/mailcow-dockerized/ root@target-machine.example.com:/opt/mailcow-dockerized
rsync -aHhP --numeric-ids --delete /var/lib/docker/volumes/ root@target-machine.example.com:/var/lib/docker/volumes
```
**4\.** Fahren Sie mailcow herunter und stoppen Sie Docker auf dem Quellrechner.
=== "docker compose (Plugin)"
``` bash
cd /opt/mailcow-dockerized
docker compose down
systemctl stop docker.service
```
=== "docker-compose (Standalone)"
``` bash
cd /opt/mailcow-dockerized
docker-compose down
systemctl stop docker.service
```
**5\.** Wiederholen Sie Schritt 3 mit den gleichen Befehlen. Dies geht wesentlich schneller als beim ersten Mal, da diesmal nur die Unterschiede (Diffs) synchronisiert werden müssen.
**6\.** Wechseln Sie auf den Zielrechner und starten Sie Docker.
```
systemctl start docker.service
```
**7\.** Laden Sie die Docker Images für mailcow auf dem Zielserver herunter.
=== "docker compose (Plugin)"
``` bash
cd /opt/mailcow-dockerized
docker compose pull
```
=== "docker-compose (Standalone)"
``` bash
cd /opt/mailcow-dockerized
docker-compose pull
```
**8\.** Starten Sie den gesamten mailcow-Stack und warten Sie einen Moment.
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker compose up -d
```
Wenn alles funktioniert hat, sollte mailcow auf dem neuen Server genauso aussehen und funktionieren wie auf dem alten Server!
**9\.** Zum Schluss ändern Sie Ihre DNS-Einstellungen so, dass sie auf den Zielserver zeigen. Überprüfen und ändern Sie ggf. die Variable `SNAT_TO_SOURCE` in der Datei `mailcow.conf` im Verzeichnis mailcow-dockerized, da SOGo sonst nicht richtig funktioniert, wenn die ausgehende IP unterschiedlich ist.
**10\.** Freude an mailcow auf dem neuen Server haben! :grinning:
---
## ...auf einen anderen Systemtyp (x86 auf ARM64 und umgekehrt)
!!! warning "Warnung"
Diese Anleitung geht davon aus, dass Sie einen bestehenden mailcow-Server (Quelle) auf einen neuen, leeren Server (Ziel) migrieren wollen. Seien Sie sich bewusst, dass, wenn Sie dieser Anleitung folgen, **ALLE** Docker Volumes (standardmäßig `/var/lib/docker/volumes`) und somit alle Daten in diesen Volumes gelöscht werden.
!!! info "Hinweis"
Alternativ können Sie das Skript `./helper-scripts/backup_and_restore.sh` verwenden, um ein vollständiges Backup auf der Quellmaschine zu erstellen.
In diesem Fall sollten Sie jedoch Rspamd aus dem Backup-Prozess ausschließen (verwenden Sie nicht `all` als Backup-Option), da es sonst aufgrund von Architekturunterschieden zu Problemen während des Startvorgangs kommen kann.
Installieren Sie dann mailcow auf der Zielmaschine wie gewohnt, kopieren Sie Ihre mailcow.conf (aus dem Backup-Ordner) und verwenden Sie dasselbe Skript, um Ihr Backup auf der Zielmaschine wiederherzustellen.
**1\.**
Befolgen Sie die [Installationsanleitung](../getting-started/i_u_m_install.de.md) von Docker und Compose.
**2\.** Stoppen Sie Docker und stellen Sie sicher, dass Docker gestoppt wurde:
```
systemctl stop docker.service
systemctl status docker.service
```
**3\.** Führen Sie die folgenden Befehle auf dem Quellcomputer aus (achten Sie darauf, die Schrägstriche am Ende des ersten Pfadparameters wie unten gezeigt hinzuzufügen).
!!! danger "Vorsicht"
Dieser Befehl (der Zweite) löscht alles, was sich bereits unter `/var/lib/docker/volumes` auf dem Zielserver befindet. Stellen Sie also sicher, dass sich nichts Wichtiges mehr auf dem Zielserver befindet, bevor Sie die folgenden Befehle ausführen!
```
rsync -aHhP --numeric-ids --delete /opt/mailcow-dockerized/ root@target-machine.example.com:/opt/mailcow-dockerized
rsync -aHhP --numeric-ids --exclude --exclude=*rspamd-vol* --delete /var/lib/docker/volumes/ root@target-machine.example.com:/var/lib/docker/volumes
```
!!! info "Hinweis"
Im Vergleich zur Migration auf die gleiche Architektur wird hier das Rspamd-Volume ausgelassen, da es sonst zu Problemen beim Start des Rspamd-Containers kommen kann.
Die entsprechenden Daten des Rspamd-Volumes werden jedoch beim ersten Start auf der neuen Architektur automatisch regeneriert, so dass es keinen Unterschied in der Nutzung geben sollte.
**4\.** Fahren Sie mailcow herunter und stoppen Sie Docker auf dem Quellrechner.
=== "docker compose (Plugin)"
``` bash
cd /opt/mailcow-dockerized
docker compose down
systemctl stop docker.service
```
=== "docker-compose (Standalone)"
``` bash
cd /opt/mailcow-dockerized
docker-compose down
systemctl stop docker.service
```
**5\.** Wiederholen Sie Schritt 3 mit den gleichen Befehlen. Dies geht wesentlich schneller als beim ersten Mal, da diesmal nur die Unterschiede (Diffs) synchronisiert werden müssen.
**6\.** Wechseln Sie auf den Zielrechner und starten Sie Docker.
```
systemctl start docker.service
```
**7\.** Laden Sie die Docker Images für mailcow auf dem Zielserver herunter.
=== "docker compose (Plugin)"
``` bash
cd /opt/mailcow-dockerized
docker compose pull
```
=== "docker-compose (Standalone)"
``` bash
cd /opt/mailcow-dockerized
docker-compose pull
```
**8\.** Starten Sie den gesamten mailcow-Stack und warten Sie einen Moment.
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker compose up -d
```
Wenn alles funktioniert hat, sollte mailcow auf dem neuen Server genauso aussehen und funktionieren wie auf dem alten Server!
**9\.** Zum Schluss ändern Sie Ihre DNS-Einstellungen so, dass sie auf den Zielserver zeigen. Überprüfen und ändern Sie ggf. die Variable `SNAT_TO_SOURCE` in der Datei `mailcow.conf` im Verzeichnis mailcow-dockerized, da SOGo sonst nicht richtig funktioniert, wenn die ausgehende IP unterschiedlich ist.
**10\.** Freude an mailcow auf dem neuen Server haben! :grinning:

Datei anzeigen

@ -1,3 +1,5 @@
### Migration within the same system type (x86 to x86, ARM64 to ARM64, etc.)
!!! warning
This guide assumes you intend to migrate an existing mailcow server (source) over to a brand new, empty server (target). It takes no care about preserving any existing data on your target server and will erase anything within `/var/lib/docker/volumes` and thus any Docker volumes you may have already set up.
@ -5,7 +7,7 @@
Alternatively, you can use the `./helper-scripts/backup_and_restore.sh` script to create a full backup on the source machine, then install mailcow on the target machine as usual, copy over your `mailcow.conf` and use the same script to restore your backup to the target machine.
**1\.**
Follow the [installation guide](i_u_m_install.en.md) to install Docker and Compose.
Follow the [installation guide](../getting-started/i_u_m_install.en.md) to install Docker and Compose.
**2\.** Stop Docker and assure Docker has stopped:
```
@ -13,7 +15,11 @@ systemctl stop docker.service
systemctl status docker.service
```
**3\.** Run the following commands on the source machine (take care of adding the trailing slashes in the first path parameter as shown below!) - **WARNING: This command will erase anything that may already exist under `/var/lib/docker/volumes` on the target machine**:
**3\.** Run the following commands on the source machine (take care of adding the trailing slashes in the first path parameter as shown below!)
!!! danger
This command (the second one) deletes everything that is already under `/var/lib/docker/volumes` on the target server. So make sure that nothing important is left on the target server before running the following commands!
```
rsync -aHhP --numeric-ids --delete /opt/mailcow-dockerized/ root@target-machine.example.com:/opt/mailcow-dockerized
rsync -aHhP --numeric-ids --delete /var/lib/docker/volumes/ root@target-machine.example.com:/var/lib/docker/volumes
@ -36,7 +42,7 @@ rsync -aHhP --numeric-ids --delete /var/lib/docker/volumes/ root@target-machine.
systemctl stop docker.service
```
**5\.** Repeat step 3 with the same commands. This will be much quicker than the first time.
**5\.** Repeat step 3 with the same commands. This is much faster than the first time, because this time only the diffs have to be synchronized.
**6\.** Switch over to the target machine and start Docker.
```
@ -58,7 +64,7 @@ systemctl start docker.service
docker-compose pull
```
**8\.** Start the whole mailcow stack and everything should be done!
**8\.** Start the whole mailcow stack and wait a moment.
=== "docker compose (Plugin)"
``` bash
@ -70,5 +76,10 @@ systemctl start docker.service
``` bash
docker compose up -d
```
If everything worked, mailcow should look and work the same on the new server as it did on the old one!
**9\.** Finally, change your DNS settings to point to the target server. Also check the `SNAT_TO_SOURCE` variable in your `mailcow.conf` file if you have changed your public IP address, otherwise SOGo may not work.
**10\.** Enjoy mailcow on the new server! :grinning:
---

Datei anzeigen

@ -123,6 +123,6 @@ Sollte alles problemlos geklappt haben (wofür wir ja auch vorsichtshalber ein B
!!! info
Wir empfehlen die Benutzung des Nightly Updates nur dann, wenn Ihr eine weitere Maschine oder VM besitzt und diese **NICHT** Produktiv nutzt.
1. Das [Cold-Standby Skript](../backup_restore/b_n_r-coldstandby.de.md) nutzen um die Maschine **vor** dem Schwenk auf die Nightly Builds auf ein anderes System zu kopieren.
1. Das [Cold-Standby Skript](../backup_restore_migrate/b_r_m-coldstandby.de.md) nutzen um die Maschine **vor** dem Schwenk auf die Nightly Builds auf ein anderes System zu kopieren.
2. Das `update.sh` Skript auf der neuen Maschine mit dem Parameter `--nightly` ausführen und bestätigen.
3. Die Nightly Updates auf der sekundären Maschine erleben/testen.

Datei anzeigen

@ -123,6 +123,6 @@ If everything worked fine (for which we made a backup before) the mailcow UI sho
!!! info
We recommend using the Nightly Update only if you have another machine or VM and **NOT** use it productively.
1. use the [cold standby script](../backup_restore/b_n_r-coldstandby.en.md) to copy the machine **before** the switch to the nightly builds on another system.
1. use the [cold standby script](../backup_restore_migrate/b_r_m-coldstandby.en.md) to copy the machine **before** the switch to the nightly builds on another system.
2. run the `update.sh` script on the new machine with the parameter `--nightly` and confirm.
3. experience/test the nightly updates on the secondary machine.

Datei anzeigen

@ -6,7 +6,7 @@ Bevor Sie **mailcow: dockerized** ausführen, sollten Sie einige Voraussetzungen
!!! info
- mailcow: dockerized erfordert, dass [einige Ports](#standard-ports) für eingehende Verbindungen offen sind, also stellen Sie sicher, dass Ihre Firewall diese nicht blockiert.
- Stellen Sie sicher, dass keine andere Anwendung die Konfiguration von mailcow stört, wie z.B. ein anderer Maildienst
- Ein korrektes DNS-Setup ist entscheidend für jedes gute Mailserver-Setup, also stellen Sie bitte sicher, dass Sie zumindest die [basics](../prerequisite/prerequisite-dns.de.md#die-minimale-dns-konfiguration) abgedeckt haben, bevor Sie beginnen!
- Ein korrektes DNS-Setup ist entscheidend für jedes gute Mailserver-Setup, also stellen Sie bitte sicher, dass Sie zumindest die [basics](prerequisite-dns.de.md#die-minimale-dns-konfiguration) abgedeckt haben, bevor Sie beginnen!
- Stellen Sie sicher, dass Ihr System ein korrektes Datum und eine korrekte [Zeiteinstellung](#datum-und-uhrzeit) hat. Dies ist entscheidend für verschiedene Komponenten wie die Zwei-Faktor-TOTP-Authentifizierung.
## Minimale Systemressourcen
@ -21,9 +21,9 @@ Bitte stellen Sie sicher, dass Ihr System mindestens über die folgenden Ressour
| CPU | 1 GHz |
| RAM | **Minimum** 6 GiB + 1 GiB Swap (Standardkonfiguration) |
| Festplatte | 20 GiB (ohne Emails) |
| Systemtyp | x86_64 |
| Systemtyp | x86_64, **AArch64 (ARM64)** :warning:{ title="Aktuell in Arbeit, Stabilität kann evtl. beeinträchtigt sein" } |
ClamAV und Solr können sehr viel Arbeitspeicher verbrauchen. Sie können diese in der `mailcow.conf` durch die Einstellungen `SKIP_CLAMD=y` und `SKIP_SOLR=y` jedoch auch deaktivieren.
ClamAV und Solr können sehr viel Arbeitsspeicher verbrauchen. Sie können diese in der `mailcow.conf` durch die Einstellungen `SKIP_CLAMD=y` und `SKIP_SOLR=y` jedoch auch deaktivieren.
!!! info
Wir sind uns bewusst, dass ein reiner MTA auf 128 MiB RAM laufen kann.
@ -44,13 +44,13 @@ Im Rahmen unseres Supports können wir Ihnen bei der korrekten Planung Ihres Set
Grundsätzlich kann mailcow auf jeder Distribution verwendet werden, die von Docker CE unterstützt wird (siehe https://docs.docker.com/install/).
Es kann jedoch in vereinzelten Fällen zu einer Inkompatibilität der Betriebssysteme und den mailcow Komponenten kommen.
Die folgende Tabelle enthält alle von uns offiziell unterstützten und getesteten Betriebssysteme (*Stand Juni 2023*):
Die folgende Tabelle enthält alle von uns offiziell unterstützten und getesteten Betriebssysteme (*Stand April 2023*):
| Betriebssystem | Kompatibilität |
| ----------------------- | ------------------------------------------------ |
| Alpine 3.16 und älter | [⚠️](https://www.alpinelinux.org/ "Eingeschränkt Kompatibel") |
| Centos 7 | [](https://www.centos.org/ "Vollständig Kompatibel") |
| Debian 10, 11, 12 | [](https://www.debian.org/index.de.html "Vollständig Kompatibel") |
| Debian 10, 11 | [](https://www.debian.org/index.de.html "Vollständig Kompatibel") |
| Ubuntu 18.04, 20.04, 22.04 | [](https://ubuntu.com/ "Vollständig Kompatibel")|
| Alma Linux 8 | [](https://almalinux.org/ "Vollständig Kompatibel") |
| Rocky Linux 9 | [](https://rockylinux.org/ "Vollständig Kompatibel") |
@ -199,4 +199,4 @@ Sie können außerdem die [cloud-init Netzwerkänderungen deaktivieren.](https:/
## MTU
Besonders relevant für OpenStack-Benutzer: Überprüfen Sie Ihre MTU und setzen Sie sie entsprechend in docker-compose.yml. Siehe [Problebehandlungen](../i_u_m/i_u_m_install.de.md#benutzer-mit-einer-mtu-ungleich-1500-zb-openstack) in unseren Installationsanleitungen.
Besonders relevant für OpenStack-Benutzer: Überprüfen Sie Ihre MTU und setzen Sie sie entsprechend in docker-compose.yml. Siehe [Problebehandlungen](i_u_m_install.de.md#benutzer-mit-einer-mtu-ungleich-1500-zb-openstack) in unseren Installationsanleitungen.

Datei anzeigen

@ -6,7 +6,7 @@ Before you run **mailcow: dockerized**, there are a few requirements that you sh
!!! info
- mailcow: dockerized requires [some ports](#default-ports) to be open for incoming connections, so make sure that your firewall is not blocking these.
- Make sure that no other application is interfering with mailcow's configuration, such as another mail service
- A correct DNS setup is crucial to every good mailserver setup, so please make sure you got at least the [basics](../prerequisite/prerequisite-dns.en.md#the-minimal-dns-configuration) covered before you begin!
- A correct DNS setup is crucial to every good mailserver setup, so please make sure you got at least the [basics](prerequisite-dns.en.md#the-minimal-dns-configuration) covered before you begin!
- Make sure that your system has a correct date and [time setup](#date-and-time). This is crucial for various components like two factor TOTP authentication.
## Minimum System Resources
@ -21,7 +21,7 @@ Please make sure that your system has at least the following resources:
| CPU | 1 GHz |
| RAM | **Minimum** 6 GiB + 1 GiB swap (default config) |
| Disk | 20 GiB (without emails) |
| System Type | x86_64 |
| System Type | x86_64, **AArch64 (ARM64)** :warning:{ title="Work in progress, Stability may possibly be affected" } |
ClamAV and Solr can be greedy with RAM. You may disable them in `mailcow.conf` by settings `SKIP_CLAMD=y` and `SKIP_SOLR=y`.
@ -42,13 +42,13 @@ We can help to correctly plan your setup as part of our support.
Basically, mailcow can be used on any distribution that is supported by Docker CE (see https://docs.docker.com/install/).
However, in some cases there may be incompatibilities between the operating systems and the mailcow components.
The following table contains all operating systems officially supported and tested by us (*as of June 2023*):
The following table contains all operating systems officially supported and tested by us (*as of April 2022*):
| OS | Compatibility |
| ----------------------- | ------------------------------------------------ |
| Alpine 3.17+ and older | [⚠️](https://www.alpinelinux.org/ "Limited Compatibility") |
| Centos 7 | [](https://www.centos.org/ "Fully Compatible") |
| Debian 10, 11, 12 | [](https://www.debian.org/index.html "Fully Compatible") |
| Debian 10, 11 | [](https://www.debian.org/index.html "Fully Compatible") |
| Ubuntu 18.04, 20.04, 22.04 | [](https://ubuntu.com/ "Fully Compatible")|
| Alma Linux 8 | [](https://almalinux.org/ "Fully Compatible") |
| Rocky Linux 9 | [](https://rockylinux.org/ "Fully Compatible") |
@ -197,4 +197,4 @@ You may want to [disable cloud-init network changes.](https://wiki.hetzner.de/in
## MTU
Especially relevant for OpenStack users: Check your MTU and set it accordingly in docker-compose.yml. See [Troubleshooting](../i_u_m/i_u_m_install.md#users-with-a-mtu-not-equal-to-1500-eg-openstack) in our Installation guide.
Especially relevant for OpenStack users: Check your MTU and set it accordingly in docker-compose.yml. See [Troubleshooting](i_u_m_install.md#users-with-a-mtu-not-equal-to-1500-eg-openstack) in our Installation guide.

Datei anzeigen

@ -1,74 +0,0 @@
!!! warning "Warnung"
Diese Anleitung geht davon aus, dass Sie beabsichtigen, einen bestehenden mailcow-Server (Quelle) auf einen brandneuen, leeren Server (Ziel) zu migrieren. Sie kümmert sich nicht um die Erhaltung bestehender Daten auf dem Zielserver und löscht alles innerhalb von `/var/lib/docker/volumes` und somit alle Docker-Volumes, die Sie bereits eingerichtet haben.
!!! tip
Alternativ können Sie das Skript `./helper-scripts/backup_and_restore.sh` verwenden, um ein vollständiges Backup auf der Quellmaschine zu erstellen, dann installieren Sie mailcow auf der Zielmaschine wie gewohnt, kopieren Sie Ihre `mailcow.conf` und verwenden Sie das gleiche Skript, um Ihr Backup auf der Zielmaschine wiederherzustellen.
**1\.**
Befolgen Sie die [Installationsanleitung](i_u_m_install.de.md) von Docker und Compose.
**2\.** Stoppen Sie Docker und stellen Sie sicher, dass Docker gestoppt wurde:
```
systemctl stop docker.service
systemctl status docker.service
```
**3\.** Führen Sie die folgenden Befehle auf dem Quellcomputer aus (achten Sie darauf, die abschließenden Schrägstriche im ersten Pfadparameter wie unten gezeigt hinzuzufügen!) - **WARNUNG: Dieser Befehl löscht alles, was bereits unter `/var/lib/docker/volumes` auf dem Zielrechner existiert**:
```
rsync -aHhP --numeric-ids --delete /opt/mailcow-dockerized/ root@target-machine.example.com:/opt/mailcow-dockerized
rsync -aHhP --numeric-ids --delete /var/lib/docker/volumes/ root@target-machine.example.com:/var/lib/docker/volumes
```
**4\.** Schalten Sie mailcow ab und stoppen Sie Docker auf dem Quellrechner.
=== "docker compose (Plugin)"
``` bash
cd /opt/mailcow-dockerized
docker compose down
systemctl stop docker.service
```
=== "docker-compose (Standalone)"
``` bash
cd /opt/mailcow-dockerized
docker-compose down
systemctl stop docker.service
```
**Wiederholen Sie Schritt 3 mit denselben Befehlen. Dies wird viel schneller gehen als beim ersten Mal.
**6\.** Wechseln Sie auf den Zielrechner und starten Sie Docker.
```
systemctl start docker.service
```
**7\.** Ziehen Sie nun die mailcow Docker-Images auf den Zielrechner.
=== "docker compose (Plugin)"
``` bash
cd /opt/mailcow-dockerized
docker compose pull
```
=== "docker-compose (Standalone)"
``` bash
cd /opt/mailcow-dockerized
docker-compose pull
```
**8\.** Starten Sie den gesamten mailcow-Stack und alles sollte fertig sein!
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker compose up -d
```
**9\.** Zum Schluss ändern Sie Ihre DNS-Einstellungen so, dass sie auf den Zielserver zeigen. Prüfen und ändern Sie gegebenenfalls die `SNAT_TO_SOURCE` Variable in der `mailcow.conf` im mailcow-dockerized Ordner, da andernfalls SOGo nicht richtig funktioniert, wenn die ausgehende IP eine andere ist.

Datei anzeigen

@ -2,7 +2,7 @@
![mailcow Logo](assets/images/logo.svg){ width="150" }
</figure>
# mailcow: dockerized - :cow: + :whale: = :two_hearts:
# mailcow: dockerized - 🐮 + 🐋 = 💕
**Die Mailserver-Suite mit dem 'moo'**
## Was ist mailcow: dockerized?

Datei anzeigen

@ -2,7 +2,7 @@
![mailcow Logo](assets/images/logo.svg){ width="150" }
</figure>
# mailcow: dockerized - :cow: + :whale: = :two_hearts:
# mailcow: dockerized - 🐮 + 🐋 = 💕
**The mailserver suite with the 'moo'**
## What is mailcow: dockerized?

Datei anzeigen

@ -1,21 +1,14 @@
Öffnen Sie `data/conf/postfix/extra.cf` und setzen Sie das `message_size_limit` entsprechend in Bytes. Siehe `main.cf` für den Standardwert.
Sie müssen auch die Nachrichtengröße in den Konfigurationen von Rspamd und Clamav anpassen:
+ in `data/conf/rspamd/local.d/options.inc` fügen Sie den `max_message` Parameter entsprechend den im Postfix gesetzten Wert hinzu. Ziehen Sie die [Rspamd Docs](https://rspamd.com/doc/configuration/options.html#:~:text=DoS%20(default%3A%201024)-,max_message,-maximum%20size%20of) für den Standardwert zu rate.
+ in `data/conf/rspamd/local.d/external_services.conf` ändern Sie den Wert `max_size` Parameter für `oletools`
+ in `data/conf/rspamd/local.d/antivirus.conf` ändern Sie den Wert `max_size` Parameter für `clamav`
+ in `data/conf/clamav/clamd.conf` ändern Sie den Wert `MaxScanSize` und `MaxFileSize` auf dieselbe Größe wie in der Postfix `extra.cf`
Starten Sie Postfix, Rspamd and Clamav neu:
Starten Sie Postfix neu:
=== "docker compose (Plugin)"
``` bash
docker compose restart postfix-mailcow rspamd-mailcow clamd-mailcow
docker compose restart postfix-mailcow
```
=== "docker-compose (Standalone)"
``` bash
docker-compose restart postfix-mailcow rspamd-mailcow clamd-mailcow
docker-compose restart postfix-mailcow
```

Datei anzeigen

@ -1,22 +1,14 @@
Open `data/conf/postfix/extra.cf` and set the `message_size_limit` accordingly in bytes. See `main.cf` for the default value.
You will also need to adjust message size in Rspamd and Clamav configurations:
+ in `data/conf/rspamd/local.d/options.inc` add `max_message` parameter, check [Rspamd Docs](https://rspamd.com/doc/configuration/options.html#:~:text=DoS%20(default%3A%201024)-,max_message,-maximum%20size%20of) for defaults
+ in `data/conf/rspamd/local.d/external_services.conf` adjust `max_size` parameter for `oletools`
+ in `data/conf/rspamd/local.d/antivirus.conf` adjust `max_size` parameter for `clamav`
+ in `data/conf/clamav/clamd.conf` adjust `MaxScanSize` and `MaxFileSize`
Restart Postfix, Rspamd and Clamav:
Restart Postfix:
=== "docker compose (Plugin)"
``` bash
docker compose restart postfix-mailcow rspamd-mailcow clamd-mailcow
docker compose restart postfix-mailcow
```
=== "docker-compose (Standalone)"
``` bash
docker-compose restart postfix-mailcow rspamd-mailcow clamd-mailcow
docker-compose restart postfix-mailcow
```

Datei anzeigen

@ -109,7 +109,6 @@ Wenn redis-cli sich beschwert über...
...das Schlüsselmuster nicht gefunden wurde und somit keine Daten zum Löschen vorhanden sind - ist es in Ordnung.
## CLI-Werkzeuge
=== "docker compose (Plugin)"
``` bash
@ -234,7 +233,6 @@ GLOBAL_RCPT_BL {
```
3. Speichern Sie die Datei und starten Sie Rspamd neu:
=== "docker compose (Plugin)"
``` bash
@ -357,7 +355,7 @@ Danach müssen Sie die Konfigurationsparameter des Modules in `data/conf/rspamd/
Falls das Modul `my_plugin.lua` heißt, sollte die Datei wie folgt aussehen:
```
# rspamd.conf.local
# rspamd.conf.local
my_plugin {
some_setting = "some value";
}
@ -366,12 +364,13 @@ my_plugin {
Falls Ihr Modul keine zusätzlichen Konfigurationen benötigt, reicht es aus einen leeren Konfigurationsblock hinzuzufügen. Wie im folgenden Beispiel zu sehen:
```
# rspamd.conf.local
# rspamd.conf.local
my_plugin { }
```
Falls Sie keinen Konfigurationsblock hinzufügen, dann wird das Modul automatisch deaktiviert und im Logfile des rspamd-mailcow Containers sehen Sie folgende Nachricht:
```
mailcowdockerized-rspamd-mailcow-1 | 2023-05-20 14:01:32 #1(main) <sh6j9z>; cfg; rspamd_config_is_module_enabled: lua module my_plugin is enabled but has not been configured
mailcowdockerized-rspamd-mailcow-1 | 2023-05-20 14:01:32 #1(main) <sh6j9z>; cfg; rspamd_config_is_module_enabled: my_plugin disabling unconfigured lua module
@ -380,5 +379,4 @@ mailcowdockerized-rspamd-mailcow-1 | 2023-05-20 14:01:32 #1(main) <sh6j9z>; cfg
Falls Sie das Modul erfolgreich konfiguiert haben, dann sollte das Logfile des rspamd-mailcow Containers wie folgt aussehen:
```
mailcowdockerized-rspamd-mailcow-1 | 2023-05-20 14:04:50 #1(main) <8ayxpf>; cfg; rspamd_init_lua_filters: init lua module my_plugin from /etc/rspamd/plugins.d//my_plugin.lua; digest: 5cb88961e5
```
mailcowdockerized-rspamd-mailcow-1 | 2023-05-20 14:04:50 #1(main) <8ayxpf>; cfg; rspamd_init_lua_filters: init lua module my_plugin from /etc/rspamd/plugins.d//my_plugin.lua; digest: 5cb88961e5

Datei anzeigen

@ -108,8 +108,8 @@ If redis-cli complains about...
...the key pattern was not found and thus no data is available to delete - it is fine.
## CLI tools
## CLI tools
=== "docker compose (Plugin)"
``` bash
@ -194,6 +194,12 @@ To reset custom defined thresholds, run:
# or:
docker-compose exec mysql-mailcow mysql -umailcow -p$DBPASS mailcow -e "delete from filterconf where option = 'highspamlevel' or option = 'lowspamlevel' and object = 'only-this-mailbox@example.org';"
```
```
source mailcow.conf
docker compose exec mysql-mailcow mysql -umailcow -p$DBPASS mailcow -e "delete from filterconf where option = 'highspamlevel' or option = 'lowspamlevel';"
# or:
# docker compose exec mysql-mailcow mysql -umailcow -p$DBPASS mailcow -e "delete from filterconf where option = 'highspamlevel' or option = 'lowspamlevel' and object = 'only-this-mailbox@example.org';"
```
## Custom reject messages
@ -234,7 +240,6 @@ GLOBAL_RCPT_BL {
```
3. Save the file and restart Rspamd:
=== "docker compose (Plugin)"
``` bash
@ -356,7 +361,7 @@ Next, add any necessary configuration for your module to `data/conf/rspamd/rspam
If you have a module named `my_plugin.lua`, configuration might look like the following:
```
# rspamd.conf.local
# rspamd.conf.local
my_plugin {
some_setting = "some value";
}
@ -365,7 +370,7 @@ my_plugin {
If your module does not require any additional configuration, simply add an empty configuration block, for example:
```
# rspamd.conf.local
# rspamd.conf.local
my_plugin { }
```
@ -380,4 +385,4 @@ If you have successfully configured your module, the rspamd-mailcow container lo
```
mailcowdockerized-rspamd-mailcow-1 | 2023-05-20 14:04:50 #1(main) <8ayxpf>; cfg; rspamd_init_lua_filters: init lua module my_plugin from /etc/rspamd/plugins.d//my_plugin.lua; digest: 5cb88961e5
```
```

Datei anzeigen

@ -1,7 +1,7 @@
!!! info "Hinweis"
Um diese Funktion nutzen zu können ist das Update 2022-05 (oder höher) erforderlich!<br>
Sollten Sie das Update nicht installiert haben, denken Sie bitte über ein Update nach.<br>
Für weitere Informationen bezüglich dem Update Prozess schauen Sie [hier](../../i_u_m/i_u_m_update.md).
Für weitere Informationen bezüglich dem Update Prozess schauen Sie [hier](../../getting-started/i_u_m_update.md).
### Wofür wurden die Tags implementiert?
Mit den Tags ist es deutlich einfacher gezielt nach Domains bzw. Mailboxen zu suchen (wenn diese einen Tag haben).

Datei anzeigen

@ -1,7 +1,7 @@
!!! info
You need the mailcow Version 2022-05 at least for this feature.<br>
If you don´t have the Version installed please consider a update.<br>
For more informations about a mailcow update please take a look at the [Update](../../i_u_m/i_u_m_update.md) section here in the docs.
For more informations about a mailcow update please take a look at the [Update](../../getting-started/i_u_m_update.md) section here in the docs.
### What are Tags designed for?
With the Tags you can easily sort your Domains and Mailboxes by the tags instead of their name.

Datei anzeigen

@ -1,6 +1,6 @@
Seit dem 28. Februar 2017 wird mailcow mit aktivierten Ports 80 und 443 geliefert.
**Verwenden Sie die untenstehende Konfiguration nicht für Reverse-Proxy-Setups**, bitte lesen Sie dazu unsere [Reverse-Proxy-Anleitung](../post_installation/reverse-proxy/r_p.md), die einen Redirect von HTTP zu HTTPS beinhaltet.
**Verwenden Sie die untenstehende Konfiguration nicht für Reverse-Proxy-Setups**, bitte lesen Sie dazu unsere [Reverse-Proxy-Anleitung](../post_installation/firststeps-rp.md), die einen Redirect von HTTP zu HTTPS beinhaltet.
Öffne `mailcow.conf` und setze `HTTP_BIND=` - falls nicht bereits gesetzt.
@ -49,4 +49,4 @@ Andernfalls starten Sie Nginx neu:
``` bash
docker compose restart
```
```

Datei anzeigen

@ -1,6 +1,6 @@
Since February the 28th 2017 mailcow does come with port 80 and 443 enabled.
**Do not use the config below for reverse proxy setups**, please see our [reverse proxy guide](../post_installation/reverse-proxy/r_p.md) for this, which includes a redirect from HTTP to HTTPS.
**Do not use the config below for reverse proxy setups**, please see our [reverse proxy guide](../post_installation/firststeps-rp.md) for this, which includes a redirect from HTTP to HTTPS.
Open `mailcow.conf` and set `HTTP_BIND=` - if not already set.
@ -49,4 +49,4 @@ Otherwise restart Nginx:
``` bash
docker compose restart
```
```

Datei anzeigen

@ -0,0 +1,390 @@
Sie müssen die Nginx-Seite, die mit mailcow: dockerized geliefert wird, nicht ändern.
mailcow: dockerized vertraut auf das Standard-Gateway IP 172.22.1.1 als Proxy.
1\. Stellen Sie sicher, dass Sie HTTP_BIND und HTTPS_BIND in `mailcow.conf` auf eine lokale Adresse ändern und die Ports entsprechend einstellen, zum Beispiel:
``` bash
HTTP_BIND=127.0.0.1
HTTP_PORT=8080
HTTPS_BIND=127.0.0.1
HTTPS_PORT=8443
```
Dadurch werden auch die Bindungen innerhalb des Nginx-Containers geändert! Dies ist wichtig, wenn Sie sich entscheiden, einen Proxy innerhalb von Docker zu verwenden.
**WICHTIG:** Verwenden Sie nicht Port 8081, 9081 oder 65510!
Erzeugen Sie die betroffenen Container neu, indem Sie den folgenden Befehl ausführen:
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker-compose up -d
```
**Wichtige Informationen, bitte lesen Sie diese sorgfältig durch!**
!!! info
Wenn Sie planen, einen Reverse-Proxy zu verwenden und einen anderen Servernamen als **MAILCOW_HOSTNAME** verwenden wollen, müssen Sie **Zusätzliche Servernamen für mailcow UI** am Ende dieser Seite hinzufügen.
!!! warning "Warnung"
Stellen Sie sicher, dass Sie `generate_config.sh` ausführen, bevor Sie die untenstehenden Konfigurationsbeispiele aktivieren.
Das Skript `generate_config.sh` kopiert die Snake-oil Zertifikate an den richtigen Ort, so dass die Dienste nicht aufgrund fehlender Dateien nicht starten können.
!!! warning "Warnung"
Wenn Sie TLS SNI aktivieren (`ENABLE_TLS_SNI` in mailcow.conf), **müssen** die Zertifikatspfade in Ihrem Reverse-Proxy mit den korrekten Pfaden in data/assets/ssl/{hostname} übereinstimmen. Die Zertifikate werden in `data/assets/ssl/{hostname1,hostname2,etc}` aufgeteilt und werden daher nicht funktionieren, wenn Sie die Beispiele von unten kopieren, die auf `data/assets/ssl/cert.pem` etc. zeigen.
!!! info
Die Verwendung der untenstehenden Site-Konfigurationen wird **acme-Anfragen an mailcow** weiterleiten und es die Zertifikate selbst verwalten lassen.
Der Nachteil der Verwendung von mailcow als ACME-Client hinter einem Reverse-Proxy ist, dass Sie Ihren Webserver neu laden müssen, nachdem acme-mailcow das Zertifikat geändert/erneuert/erstellt hat. Sie können entweder Ihren Webserver täglich neu laden oder ein Skript schreiben, um die Datei auf Änderungen zu überwachen.
Auf vielen Servern wird logrotate den Webserver sowieso täglich neu laden.
Wenn Sie eine lokale Certbot-Installation verwenden möchten, müssen Sie die SSL-Zertifikatsparameter entsprechend ändern.
**Stellen Sie sicher, dass Sie ein Post-Hook-Skript** ausführen, wenn Sie sich entscheiden, externe ACME-Clients zu verwenden. Ein Beispiel finden Sie am Ende dieser Seite.
2\. Konfigurieren Sie Ihren lokalen Webserver als Reverse Proxy:
### Apache 2.4
Erforderliche Module:
```
a2enmod rewrite proxy proxy_http headers ssl
```
Let's Encrypt wird unserem Rewrite folgen, Zertifikatsanfragen in mailcow werden problemlos funktionieren.
**Die hervorgehobenen Zeilen müssen beachtet werden**.
``` apache hl_lines="2 10 11 17 22 23 24 25 30 31"
<VirtualHost *:80>
ServerName ZU MAILCOW HOSTNAMEN ÄNDERN
ServerAlias autodiscover.*
ServerAlias autoconfig.*
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^/?(.*) https://%{HTTP_HOST}/$1 [R=301,L]
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ProxyPreserveHost On
ProxyAddHeaders On
RequestHeader set X-Forwarded-Proto "http"
</VirtualHost>
<VirtualHost *:443>
ServerName ZU MAILCOW HOSTNAMEN ÄNDERN
ServerAlias autodiscover.*
ServerAlias autoconfig.*
# You should proxy to a plain HTTP session to offload SSL processing
ProxyPass /Microsoft-Server-ActiveSync http://127.0.0.1:8080/Microsoft-Server-ActiveSync connectiontimeout=4000
ProxyPassReverse /Microsoft-Server-ActiveSync http://127.0.0.1:8080/Microsoft-Server-ActiveSync
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ProxyPreserveHost On
ProxyAddHeaders On
RequestHeader set X-Forwarded-Proto "https"
SSLCertificateFile MAILCOW_ORDNER/data/assets/ssl/cert.pem
SSLCertificateKeyFile MAILCOW_ORDNER/data/assets/ssl/key.pem
# Wenn Sie einen HTTPS-Host als Proxy verwenden möchten:
#SSLProxyEngine On
# Wenn Sie einen Proxy für einen nicht vertrauenswürdigen HTTPS-Host einrichten wollen:
#SSLProxyVerify none
#SSLProxyCheckPeerCN off
#SSLProxyCheckPeerName off
#SSLProxyCheckPeerExpire off
</VirtualHost>
```
### Nginx
Let's Encrypt folgt unserem Rewrite, Zertifikatsanfragen funktionieren problemlos.
**Achten Sie auf die hervorgehobenen Zeilen**.
``` hl_lines="4 10 12 13 25 39"
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name ZU MAILCOW HOSTNAMEN ÄNDERN autodiscover.* autoconfig.*;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ZU MAILCOW HOSTNAMEN ÄNDERN autodiscover.* autoconfig.*;
ssl_certificate MAILCOW_PATH/data/assets/ssl/cert.pem;
ssl_certificate_key MAILCOW_PATH/data/assets/ssl/key.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
# Siehe https://ssl-config.mozilla.org/#server=nginx für die neuesten Empfehlungen zu ssl-Einstellungen
# Ein Beispiel für eine Konfiguration ist unten angegeben
ssl_protocols TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5:!SHA1:!kRSA;
ssl_prefer_server_ciphers off;
location /Microsoft-Server-ActiveSync {
proxy_pass http://127.0.0.1:8080/Microsoft-Server-ActiveSync;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 75;
proxy_send_timeout 3650;
proxy_read_timeout 3650;
proxy_buffers 64 512k; # Seit dem 2022-04 Update nötig für SOGo
client_body_buffer_size 512k;
client_max_body_size 0;
}
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 0;
# Die folgenden Proxy-Buffer müssen gesetzt werden, wenn Sie SOGo nach dem Update 2022-04 (April 2022) verwenden wollen
# Andernfalls wird ein Login wie folgt fehlschlagen: https://github.com/mailcow/mailcow-dockerized/issues/4537
proxy_buffer_size 128k;
proxy_buffers 64 512k;
proxy_busy_buffers_size 512k;
}
}
```
### HAProxy (von der Community unterstützt)
!!! warning "Warnung"
Dies ist ein nicht unterstützter Community Beitrag. Korrekturen sind immer erwünscht!
**Wichtig/Fix erwünscht**: Dieses Beispiel leitet nur HTTPS-Verkehr weiter und benutzt nicht den in mailcow eingebauten ACME-Client.
```
frontend https-in
bind :::443 v4v6 ssl crt mailcow.pem
default_backend mailcow
backend mailcow
option forwardfor
http-request set-header X-Forwarded-Proto https if { ssl_fc }
http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
server mailcow 127.0.0.1:8080 check
```
### Traefik v2 (von der Community unterstützt)
!!! warning "Warnung"
Dies ist ein nicht unterstützter Community Beitrag. Korrekturen sind immer erwünscht!
**Wichtig**: Diese Konfiguration deckt nur das "Reverseproxing" des Webpanels (nginx-mailcow) unter Verwendung von Traefik v2 ab. Wenn Sie auch die Mail-Dienste wie dovecot, postfix... reproxen wollen, müssen Sie die folgende Konfiguration an jeden Container anpassen und einen [EntryPoint](https://docs.traefik.io/routing/entrypoints/) in Ihrer `traefik.toml` oder `traefik.yml` (je nachdem, welche Konfiguration Sie verwenden) für jeden Port erstellen.
In diesem Abschnitt gehen wir davon aus, dass Sie Ihren Traefik 2 `[certificatesresolvers]` in Ihrer Traefik-Konfigurationsdatei richtig konfiguriert haben und auch acme verwenden. Das folgende Beispiel verwendet Lets Encrypt, aber Sie können es gerne auf Ihren eigenen Zertifikatsresolver ändern. Eine grundlegende Traefik 2 toml-Konfigurationsdatei mit allen oben genannten Elementen, die für dieses Beispiel verwendet werden kann, finden Sie hier [traefik.toml](https://github.com/Frenzoid/TraefikBasicConfig/blob/master/traefik.toml), falls Sie eine solche Datei benötigen oder einen Hinweis, wie Sie Ihre Konfiguration anpassen können.
Zuallererst werden wir den acme-mailcow-Container deaktivieren, da wir die von traefik bereitgestellten Zertifikate verwenden werden.
Dazu müssen wir `SKIP_LETS_ENCRYPT=y` in unserer `mailcow.conf` setzen und den folgenden Befehl ausführen, um die Änderungen zu übernehmen:
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker-compose up -d
```
Dann erstellen wir eine `docker-compose.override.yml` Datei, um die Hauptdatei `docker-compose.yml` zu überschreiben, die sich im mailcow-Stammverzeichnis befindet.
```yaml
version: '2.1'
services:
nginx-mailcow:
networks:
# Traefiks Netzwerk hinzufügen
web:
labels:
- traefik.enable=true
# Erstellt einen Router namens "moo" für den Container und richtet eine Regel ein, um den Container mit einer bestimmten Regel zu verknüpfen,
# in diesem Fall eine Host-Regel mit unserer MAILCOW_HOSTNAME-Variable.
- traefik.http.routers.moo.rule=Host(`${MAILCOW_HOSTNAME}`)
# Aktiviert tls über den zuvor erstellten Router.
- traefik.http.routers.moo.tls=true
# Gibt an, welche Art von Cert-Resolver wir verwenden werden, in diesem Fall le (Lets Encrypt).
- traefik.http.routers.moo.tls.certresolver=le
# Erzeugt einen Dienst namens "moo" für den Container und gibt an, welchen internen Port des Containers
# Traefik die eingehenden Daten weiterleiten soll.
- traefik.http.services.moo.loadbalancer.server.port=${HTTP_PORT}
# Gibt an, welchen Eingangspunkt (externer Port) traefik für diesen Container abhören soll.
# Websecure ist Port 443, siehe die Datei traefik.toml wie oben.
- traefik.http.routers.moo.entrypoints=websecure
# Stellen Sie sicher, dass traefik das Web-Netzwerk verwendet, nicht das mailcowdockerized_mailcow-network
- traefik.docker.network=traefik_web
certdumper:
image: humenius/traefik-certs-dumper
command: --restart-containers ${COMPOSE_PROJECT_NAME}-postfix-mailcow-1,${COMPOSE_PROJECT_NAME}-nginx-mailcow-1,${COMPOSE_PROJECT_NAME}-dovecot-mailcow-1
network_mode: none
volumes:
# Binden Sie das Volume, das Traefiks `acme.json' Datei enthält, ein
- acme:/traefik:ro
# SSL-Ordner von mailcow einhängen
- ./data/assets/ssl/:/output:rw
# Binden Sie den Docker Socket ein, damit traefik-certs-dumper die Container neu starten kann
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: always
environment:
# Ändern Sie dies nur, wenn Sie eine andere Domain für mailcows Web-Frontend verwenden als in der Standard-Konfiguration
- DOMAIN=${MAILCOW_HOSTNAME}
networks:
web:
external: true
# Name des externen Netzwerks
name: traefik_web
volumes:
acme:
external: true
# Name des externen Docker Volumes, welches Traefiks `acme.json' Datei enthält
name: traefik_acme
```
Starten Sie die neuen Container mit:
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker-compose up -d
```
Da Traefik 2 ein acme v2 Format verwendet, um ALLE Zertifikaten von allen Domains zu speichern, müssen wir einen Weg finden, die Zertifikate auszulagern. Zum Glück haben wir [diesen kleinen Container] (https://hub.docker.com/r/humenius/traefik-certs-dumper), der die Datei `acme.json` über ein Volume und eine Variable `DOMAIN=example. org`, und damit wird der Container die `cert.pem` und `key.pem` Dateien ausgeben, dafür lassen wir einfach den `traefik-certs-dumper` Container laufen, binden das `/traefik` Volume an den Ordner, in dem unsere `acme.json` gespeichert ist, binden das `/output` Volume an unseren mailcow `data/assets/ssl/` Ordner, und setzen die `DOMAIN=example.org` Variable auf die Domain, von der wir die Zertifikate ausgeben wollen.
Dieser Container überwacht die Datei `acme.json` auf Änderungen und generiert die Dateien `cert.pem` und `key.pem` direkt in `data/assets/ssl/`, wobei der Pfad mit dem `/output`-Pfad des Containers verbunden ist.
Sie können es über die Kommandozeile ausführen oder das [hier](https://hub.docker.com/r/humenius/traefik-certs-dumper) gezeigte docker-compose.yml verwenden.
Nachdem wir die Zertifikate übertragen haben, müssen wir die Konfigurationen aus unseren Postfix- und Dovecot-Containern neu laden und die Zertifikate überprüfen. Wie das geht, sehen Sie [hier](https://mailcow.github.io/mailcow-dockerized-docs/de/post_installation/firststeps-ssl/#ein-eigenes-zertifikat-verwenden).
Und das sollte es gewesen sein 😊, Sie können überprüfen, ob der Traefik-Router einwandfrei funktioniert, indem Sie das Dashboard von Traefik / traefik logs / über https auf die eingestellte Domain zugreifen, oder / und HTTPS, SMTP und IMAP mit den Befehlen auf der zuvor verlinkten Seite überprüfen.
### Caddy v2 (von der Community unterstützt)
!!! warning "Warnung"
Dies ist ein nicht unterstützter Communitybeitrag. Korrekturen sind immer erwünscht!
Die Konfiguration von Caddy mit mailcow ist sehr simpel.
In der Caddyfile muss einfach nur ein Bereich für den E-Mailserver angelegt werden.
Bspw:
``` hl_lines="1 3 13"
MAILCOW_HOSTNAME autodiscover.MAILCOW_HOSTNAME autoconfig.MAILCOW_HOSTNAME {
log {
output file /var/log/caddy/MAILCOW_HOSTNAME.log {
roll_disabled
roll_size 512M
roll_uncompressed
roll_local_time
roll_keep 3
roll_keep_for 48h
}
}
reverse_proxy 127.0.0.1:HTTP_BIND
}
```
Dies erlaubt es Caddy automatisch die Zertifikate zu erstellen und den Traffic für diese erwähnten Domains anzunehmen und an mailcow weiterzuleiten.
**Wichtig**: Der ACME Client der mailcow muss deaktiviert sein, da es sonst zu Fehlern seitens mailcow kommt.
Da Caddy sich direkt selbst um die Zertifikate kümmert, können wir mit dem folgenden Skript die Caddy generierten Zertifikate in die mailcow inkludieren:
```bash
#!/bin/bash
MD5SUM_CURRENT_CERT=($(md5sum /opt/mailcow-dockerized/data/assets/ssl/cert.pem))
MD5SUM_NEW_CERT=($(md5sum /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/your.domain.tld/your.domain.tld.crt))
if [ $MD5SUM_CURRENT_CERT != $MD5SUM_NEW_CERT ]; then
cp /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/your.domain.tld/your.domain.tld.crt /opt/mailcow-dockerized/data/assets/ssl/cert.pem
cp /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/your.domain.tld/your.domain.tld.key /opt/mailcow-dockerized/data/assets/ssl/key.pem
postfix_c=$(docker ps -qaf name=postfix-mailcow)
dovecot_c=$(docker ps -qaf name=dovecot-mailcow)
nginx_c=$(docker ps -qaf name=nginx-mailcow)
docker restart ${postfix_c} ${dovecot_c} ${nginx_c}
else
echo "Certs not copied from Caddy (Not needed)"
fi
```
!!! warning "Achtung"
Der Zertifikatspfad von Caddy variiert je nach Installationsart.<br>
Bei diesem Installationsbeispiel wurde Caddy mithilfe des Caddy Repos ([weitere Informationen hier](https://caddyserver.com/docs/install#debian-ubuntu-raspbian)) installiert.<br>
<br>
Um den Caddy Zertifikatspfad auf Ihrem System herauszufinden, genügt ein `find / -name "certificates"`.
Dieses Skript könnte dann als Cronjob jede Stunde aufgerufen werden:
```bash
0 * * * * /bin/bash /path/to/script/deploy-certs.sh >/dev/null 2>&1
```
### Optional: Post-Hook-Skript für nicht-mailcow ACME-Clients
Die Verwendung eines lokalen Certbots (oder eines anderen ACME-Clients) erfordert den Neustart einiger Container, was Sie mit einem Post-Hook-Skript erledigen können.
Stellen Sie sicher, dass Sie die Pfade entsprechend ändern:
```
#!/bin/bash
cp /etc/letsencrypt/live/my.domain.tld/fullchain.pem /opt/mailcow-dockerized/data/assets/ssl/cert.pem
cp /etc/letsencrypt/live/my.domain.tld/privkey.pem /opt/mailcow-dockerized/data/assets/ssl/key.pem
postfix_c=$(docker ps -qaf name=postfix-mailcow)
dovecot_c=$(docker ps -qaf name=dovecot-mailcow)
nginx_c=$(docker ps -qaf name=nginx-mailcow)
docker restart ${postfix_c} ${dovecot_c} ${nginx_c}
```
### Hinzufügen weiterer Servernamen für mailcow UI
Wenn Sie vorhaben, einen Servernamen zu verwenden, der nicht `MAILCOW_HOSTNAME` in Ihrem Reverse-Proxy ist, stellen Sie sicher, dass Sie diesen Namen zuerst in mailcow.conf über `ADDITIONAL_SERVER_NAMES` einpflegen. Die Namen müssen durch Kommas getrennt werden und **dürfen** keine Leerzeichen enthalten. Wenn Sie diesen Schritt überspringen, kann es sein, dass mailcow auf Ihren Reverse-Proxy mit einer falschen Seite antwortet.
```
ADDITIONAL_SERVER_NAMES=webmail.domain.tld,other.example.tld
```
Führen Sie zum Anwenden folgendes aus:
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker-compose up -d
```

Datei anzeigen

@ -0,0 +1,393 @@
You don't need to change the Nginx site that comes with mailcow: dockerized.
mailcow: dockerized trusts the default gateway IP 172.22.1.1 as proxy.
1\. Make sure you change HTTP_BIND and HTTPS_BIND in `mailcow.conf` to a local address and set the ports accordingly, for example:
``` bash
HTTP_BIND=127.0.0.1
HTTP_PORT=8080
HTTPS_BIND=127.0.0.1
HTTPS_PORT=8443
```
This will also change the bindings inside the Nginx container! This is important, if you decide to use a proxy within Docker.
**IMPORTANT:** Do not use port 8081, 9081 or 65510!
Recreate affected containers by running the command:
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker-compose up -d
```
**Important information, please read them carefully!**
!!! info
If you plan to use a reverse proxy and want to use another server name that is **not** MAILCOW_HOSTNAME, you need to read **Adding additional server names for mailcow UI** at the bottom of this page.
!!! warning
Make sure you run `generate_config.sh` before you enable any site configuration examples below.
The script `generate_config.sh` copies snake-oil certificates to the correct location, so the services will not fail to start due to missing files.
!!! warning
If you enable TLS SNI (`ENABLE_TLS_SNI` in mailcow.conf), the certificate paths in your reverse proxy **must** match the correct paths in data/assets/ssl/{hostname}. The certificates will be split into `data/assets/ssl/{hostname1,hostname2,etc}` and therefore will not work when you copy the examples from below pointing to `data/assets/ssl/cert.pem` etc.
!!! info
Using the site configs below will **forward ACME requests to mailcow** and let it handle certificates itself.
The downside of using mailcow as ACME client behind a reverse proxy is, that you will need to reload your webserver after acme-mailcow changed/renewed/created the certificate. You can either reload your webserver daily or write a script to watch the file for changes.
On many servers logrotate will reload the webserver daily anyway.
If you want to use a local certbot installation, you will need to change the SSL certificate parameters accordingly.
**Make sure you run a post-hook script** when you decide to use external ACME clients. You will find an example at the bottom of this page.
2\. Configure your local webserver as reverse proxy:
### Apache 2.4
Required modules:
```
a2enmod rewrite proxy proxy_http headers ssl
```
Let's Encrypt will follow our rewrite, certificate requests in mailcow will work fine.
**Take care of highlighted lines.**
``` apache hl_lines="2 10 11 17 22 23 24 25 30 31"
<VirtualHost *:80>
ServerName CHANGE_TO_MAILCOW_HOSTNAME
ServerAlias autodiscover.*
ServerAlias autoconfig.*
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^/?(.*) https://%{HTTP_HOST}/$1 [R=301,L]
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ProxyPreserveHost On
ProxyAddHeaders On
RequestHeader set X-Forwarded-Proto "http"
</VirtualHost>
<VirtualHost *:443>
ServerName CHANGE_TO_MAILCOW_HOSTNAME
ServerAlias autodiscover.*
ServerAlias autoconfig.*
# You should proxy to a plain HTTP session to offload SSL processing
ProxyPass /Microsoft-Server-ActiveSync http://127.0.0.1:8080/Microsoft-Server-ActiveSync connectiontimeout=4000
ProxyPassReverse /Microsoft-Server-ActiveSync http://127.0.0.1:8080/Microsoft-Server-ActiveSync
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ProxyPreserveHost On
ProxyAddHeaders On
RequestHeader set X-Forwarded-Proto "https"
SSLCertificateFile MAILCOW_PATH/data/assets/ssl/cert.pem
SSLCertificateKeyFile MAILCOW_PATH/data/assets/ssl/key.pem
# If you plan to proxy to a HTTPS host:
#SSLProxyEngine On
# If you plan to proxy to an untrusted HTTPS host:
#SSLProxyVerify none
#SSLProxyCheckPeerCN off
#SSLProxyCheckPeerName off
#SSLProxyCheckPeerExpire off
</VirtualHost>
```
### Nginx
Let's Encrypt will follow our rewrite, certificate requests will work fine.
**Take care of highlighted lines.**
``` hl_lines="4 10 12 13 25 39"
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name CHANGE_TO_MAILCOW_HOSTNAME autodiscover.* autoconfig.*;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name CHANGE_TO_MAILCOW_HOSTNAME autodiscover.* autoconfig.*;
ssl_certificate MAILCOW_PATH/data/assets/ssl/cert.pem;
ssl_certificate_key MAILCOW_PATH/data/assets/ssl/key.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
# See https://ssl-config.mozilla.org/#server=nginx for the latest ssl settings recommendations
# An example config is given below
ssl_protocols TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5:!SHA1:!kRSA;
ssl_prefer_server_ciphers off;
location /Microsoft-Server-ActiveSync {
proxy_pass http://127.0.0.1:8080/Microsoft-Server-ActiveSync;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 75;
proxy_send_timeout 3650;
proxy_read_timeout 3650;
proxy_buffers 64 512k; # Needed since the 2022-04 Update for SOGo
client_body_buffer_size 512k;
client_max_body_size 0;
}
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 0;
# The following Proxy Buffers has to be set if you want to use SOGo after the 2022-04 (April 2022) Update
# Otherwise a Login will fail like this: https://github.com/mailcow/mailcow-dockerized/issues/4537
proxy_buffer_size 128k;
proxy_buffers 64 512k;
proxy_busy_buffers_size 512k;
}
}
```
### HAProxy (community supported)
!!! warning
This is an unsupported community contribution. Feel free to provide fixes.
**Important/Fixme**: This example only forwards HTTPS traffic and does not use mailcows built-in ACME client.
```
frontend https-in
bind :::443 v4v6 ssl crt mailcow.pem
default_backend mailcow
backend mailcow
option forwardfor
http-request set-header X-Forwarded-Proto https if { ssl_fc }
http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
server mailcow 127.0.0.1:8080 check
```
### Traefik v2 (community supported)
!!! warning
This is an unsupported community contribution. Feel free to provide fixes.
**Important**: This config only covers the "reverseproxing" of the webpannel (nginx-mailcow) using Traefik v2, if you also want to reverseproxy the mail services such as dovecot, postfix... you'll just need to adapt the following config to each container and create an [EntryPoint](https://docs.traefik.io/routing/entrypoints/) on your `traefik.toml` or `traefik.yml` (depending which config you use) for each port.
For this section we'll assume you have your Traefik 2 `[certificatesresolvers]` properly configured on your traefik configuration file, and also using acme, also, the following example uses Lets Encrypt, but feel free to change it to your own cert resolver. You can find a basic Traefik 2 toml config file with all the above implemented which can be used for this example here [traefik.toml](https://github.com/Frenzoid/TraefikBasicConfig/blob/master/traefik.toml) if you need one, or a hint on how to adapt your config.
So, first of all, we are going to disable the acme-mailcow container since we'll use the certs that traefik will provide us.
For this we'll have to set `SKIP_LETS_ENCRYPT=y` on our `mailcow.conf`, and run the following command to apply the changes:
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker-compose up -d
```
Then we'll create a `docker-compose.override.yml` file in order to override the main `docker-compose.yml` found in your mailcow root folder.
```yaml
version: '2.1'
services:
nginx-mailcow:
networks:
# Add Traefik's network
web:
labels:
- traefik.enable=true
# Creates a router called "moo" for the container, and sets up a rule to link the container to certain rule,
# in this case, a Host rule with our MAILCOW_HOSTNAME var.
- traefik.http.routers.moo.rule=Host(`${MAILCOW_HOSTNAME}`)
# Enables tls over the router we created before.
- traefik.http.routers.moo.tls=true
# Specifies which kind of cert resolver we'll use, in this case le (Lets Encrypt).
- traefik.http.routers.moo.tls.certresolver=le
# Creates a service called "moo" for the container, and specifies which internal port of the container
# should traefik route the incoming data to.
- traefik.http.services.moo.loadbalancer.server.port=${HTTP_PORT}
# Specifies which entrypoint (external port) should traefik listen to, for this container.
# websecure being port 443, check the traefik.toml file liked above.
- traefik.http.routers.moo.entrypoints=websecure
# Make sure traefik uses the web network, not the mailcowdockerized_mailcow-network
- traefik.docker.network=traefik_web
certdumper:
image: humenius/traefik-certs-dumper
command: --restart-containers ${COMPOSE_PROJECT_NAME}-postfix-mailcow-1,${COMPOSE_PROJECT_NAME}-nginx-mailcow-1,${COMPOSE_PROJECT_NAME}-dovecot-mailcow-1
network_mode: none
volumes:
# Mount the volume which contains Traefik's `acme.json' file
# Configure the external name in the volume definition
- acme:/traefik:ro
# Mount mailcow's SSL folder
- ./data/assets/ssl/:/output:rw
# Mount docker socket to restart containers
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: always
environment:
# only change this, if you're using another domain for mailcow's web frontend compared to the standard config
- DOMAIN=${MAILCOW_HOSTNAME}
networks:
web:
external: true
# Name of the external network
name: traefik_web
volumes:
acme:
external: true
# Name of the external docker volume which contains Traefik's `acme.json' file
name: traefik_acme
```
Start the new containers with:
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker-compose up -d
```
Now, there's only one thing left to do, which is setup the certs so that the mail services can use them as well, since Traefik 2 uses an acme v2 format to save ALL the license from all the domains we have, we'll need to find a way to dump the certs, lucky we have [this tiny container](https://hub.docker.com/r/humenius/traefik-certs-dumper) which grabs the `acme.json` file through a volume, and a variable `DOMAIN=example.org`, and with these, the container will output the `cert.pem` and `key.pem` files, for this we'll simply run the `traefik-certs-dumper` container binding the `/traefik` volume to the folder where our `acme.json` is saved, bind the `/output` volume to our mailcow `data/assets/ssl/` folder, and set up the `DOMAIN=example.org` variable to the domain we want the certs dumped from.
This container will watch over the `acme.json` file for any changes, and regenerate the `cert.pem` and `key.pem` files directly into `data/assets/ssl/` being the path binded to the container's `/output` path.
You can use the command line to run it, or use the docker-compose.yml shown [here](https://hub.docker.com/r/humenius/traefik-certs-dumper).
After we have the certs dumped, we'll have to reload the configs from our postfix and dovecot containers, and check the certs, you can see how [here](https://mailcow.github.io/mailcow-dockerized-docs/firststeps-ssl/#how-to-use-your-own-certificate).
Aaand that should be it 😊, you can check if the Traefik router works fine through Traefik's dashboard / traefik logs / accessing the setted domain through https, or / and check HTTPS, SMTP and IMAP through the commands shown on the page linked before.
### Caddy v2 (supported by the community)
!!! warning
This is an unsupported community contribution. Feel free to provide fixes.
The configuration of Caddy with mailcow is very simple.
In the caddyfile you just have to create a section for the mailserver.
For example
``` hl_lines="1 3 13"
MAILCOW_HOSTNAME autodiscover.MAILCOW_HOSTNAME autoconfig.MAILCOW_HOSTNAME {
log {
output file /var/log/caddy/MAILCOW_HOSTNAME.log {
roll_disabled
roll_size 512M
roll_uncompressed
roll_local_time
roll_keep 3
roll_keep_for 48h
}
}
reverse_proxy 127.0.0.1:HTTP_BIND
}
```
This allows Caddy to automatically create the certificates and accept traffic for these mentioned domains and forward them to mailcow.
**Important**: The ACME client of mailcow must be disabled, otherwise mailcow will fail.
Since Caddy takes care of the certificates itself, we can use the following script to include the Caddy generated certificates into mailcow:
```bash
#!/bin/bash
MD5SUM_CURRENT_CERT=($(md5sum /opt/mailcow-dockerized/data/assets/ssl/cert.pem))
MD5SUM_NEW_CERT=($(md5sum /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/your.domain.tld/your.domain.tld.crt))
if [ $MD5SUM_CURRENT_CERT != $MD5SUM_NEW_CERT ]; then
cp /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/your.domain.tld/your.domain.tld.crt /opt/mailcow-dockerized/data/assets/ssl/cert.pem
cp /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/your.domain.tld/your.domain.tld.key /opt/mailcow-dockerized/data/assets/ssl/key.pem
postfix_c=$(docker ps -qaf name=postfix-mailcow)
dovecot_c=$(docker ps -qaf name=dovecot-mailcow)
nginx_c=$(docker ps -qaf name=nginx-mailcow)
docker restart ${postfix_c} ${dovecot_c} ${nginx_c}
else
echo "Certs not copied from Caddy (Not needed)"
fi
```
!!! warning "Attention"
Caddy's certificate path varies depending on the installation type.<br>
In this installation example, Caddy was installed using the Caddy repo ([more informations here](https://caddyserver.com/docs/install#debian-ubuntu-raspbian)).<br>
<br>
To find out the Caddy certificate path on your system, just run a `find / -name "certificates"`.
This script could be called as a cronjob every hour:
```bash
0 * * * * /bin/bash /path/to/script/deploy-certs.sh >/dev/null 2>&1
```
### Optional: Post-hook script for non-mailcow ACME clients
Using a local certbot (or any other ACME client) requires to restart some containers, you can do this with a post-hook script.
Make sure you change the paths accordingly:
```
#!/bin/bash
cp /etc/letsencrypt/live/my.domain.tld/fullchain.pem /opt/mailcow-dockerized/data/assets/ssl/cert.pem
cp /etc/letsencrypt/live/my.domain.tld/privkey.pem /opt/mailcow-dockerized/data/assets/ssl/key.pem
postfix_c=$(docker ps -qaf name=postfix-mailcow)
dovecot_c=$(docker ps -qaf name=dovecot-mailcow)
nginx_c=$(docker ps -qaf name=nginx-mailcow)
docker restart ${postfix_c} ${dovecot_c} ${nginx_c}
```
### Adding additional server names for mailcow UI
If you plan to use a server name that is not `MAILCOW_HOSTNAME` in your reverse proxy, make sure to populate that name in mailcow.conf via `ADDITIONAL_SERVER_NAMES` first. Names must be separated by commas and **must not** contain spaces. If you skip this step, mailcow may respond to your reverse proxy with an incorrect site.
```
ADDITIONAL_SERVER_NAMES=webmail.domain.tld,other.example.tld
```
Run the following command to apply:
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker-compose up -d
```

Datei anzeigen

@ -235,7 +235,7 @@ docker restart $(docker ps -qaf name=nginx-mailcow)
docker restart $(docker ps -qaf name=dovecot-mailcow)
```
Siehe [Post-Hook-Skript für Nicht-mailcow-ACME-Clients](../reverse-proxy/r_p#optional-post-hook-skript-fur-nicht-mailcow-acme-clients) für ein vollständiges Beispielskript.
Siehe [Post-Hook-Skript für Nicht-mailcow-ACME-Clients](../firststeps-rp#optional-post-hook-skript-fur-nicht-mailcow-acme-clients) für ein vollständiges Beispielskript.
### Test gegen das ACME-Verzeichnis

Datei anzeigen

@ -235,7 +235,7 @@ docker restart $(docker ps -qaf name=nginx-mailcow)
docker restart $(docker ps -qaf name=dovecot-mailcow)
```
See [Post-hook script for non-mailcow ACME clients](../reverse-proxy/r_p/#optional-post-hook-script-for-non-mailcow-acme-clients) for a full example script.
See [Post-hook script for non-mailcow ACME clients](../firststeps-rp/#optional-post-hook-script-for-non-mailcow-acme-clients) for a full example script.
### Test against staging ACME directory

Datei anzeigen

@ -1,55 +0,0 @@
!!! warning "Wichtig"
Lesen Sie zuerst [die Übersicht](r_p.md).
Erforderliche Module:
```
a2enmod rewrite proxy proxy_http headers ssl
```
Let's Encrypt wird unserem Rewrite folgen, Zertifikatsanfragen in mailcow werden problemlos funktionieren.
**Die hervorgehobenen Zeilen müssen beachtet werden**.
``` apache hl_lines="2 10 11 17 22 23 24 25 30 31"
<VirtualHost *:80>
ServerName ZU MAILCOW HOSTNAMEN ÄNDERN
ServerAlias autodiscover.*
ServerAlias autoconfig.*
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^/?(.*) https://%{HTTP_HOST}/$1 [R=301,L]
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ProxyPreserveHost On
ProxyAddHeaders On
RequestHeader set X-Forwarded-Proto "http"
</VirtualHost>
<VirtualHost *:443>
ServerName ZU MAILCOW HOSTNAMEN ÄNDERN
ServerAlias autodiscover.*
ServerAlias autoconfig.*
# You should proxy to a plain HTTP session to offload SSL processing
ProxyPass /Microsoft-Server-ActiveSync http://127.0.0.1:8080/Microsoft-Server-ActiveSync connectiontimeout=4000
ProxyPassReverse /Microsoft-Server-ActiveSync http://127.0.0.1:8080/Microsoft-Server-ActiveSync
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ProxyPreserveHost On
ProxyAddHeaders On
RequestHeader set X-Forwarded-Proto "https"
SSLCertificateFile MAILCOW_ORDNER/data/assets/ssl/cert.pem
SSLCertificateKeyFile MAILCOW_ORDNER/data/assets/ssl/key.pem
# Wenn Sie einen HTTPS-Host als Proxy verwenden möchten:
#SSLProxyEngine On
# Wenn Sie einen Proxy für einen nicht vertrauenswürdigen HTTPS-Host einrichten wollen:
#SSLProxyVerify none
#SSLProxyCheckPeerCN off
#SSLProxyCheckPeerName off
#SSLProxyCheckPeerExpire off
</VirtualHost>
```

Datei anzeigen

@ -1,55 +0,0 @@
!!! warning "Important"
First read [the overview](r_p.md).
Required modules:
```
a2enmod rewrite proxy proxy_http headers ssl
```
Let's Encrypt will follow our rewrite, certificate requests in mailcow will work fine.
**Take care of highlighted lines.**
``` apache hl_lines="2 10 11 17 22 23 24 25 30 31"
<VirtualHost *:80>
ServerName CHANGE_TO_MAILCOW_HOSTNAME
ServerAlias autodiscover.*
ServerAlias autoconfig.*
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule ^/?(.*) https://%{HTTP_HOST}/$1 [R=301,L]
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ProxyPreserveHost On
ProxyAddHeaders On
RequestHeader set X-Forwarded-Proto "http"
</VirtualHost>
<VirtualHost *:443>
ServerName CHANGE_TO_MAILCOW_HOSTNAME
ServerAlias autodiscover.*
ServerAlias autoconfig.*
# You should proxy to a plain HTTP session to offload SSL processing
ProxyPass /Microsoft-Server-ActiveSync http://127.0.0.1:8080/Microsoft-Server-ActiveSync connectiontimeout=4000
ProxyPassReverse /Microsoft-Server-ActiveSync http://127.0.0.1:8080/Microsoft-Server-ActiveSync
ProxyPass / http://127.0.0.1:8080/
ProxyPassReverse / http://127.0.0.1:8080/
ProxyPreserveHost On
ProxyAddHeaders On
RequestHeader set X-Forwarded-Proto "https"
SSLCertificateFile MAILCOW_PATH/data/assets/ssl/cert.pem
SSLCertificateKeyFile MAILCOW_PATH/data/assets/ssl/key.pem
# If you plan to proxy to a HTTPS host:
#SSLProxyEngine On
# If you plan to proxy to an untrusted HTTPS host:
#SSLProxyVerify none
#SSLProxyCheckPeerCN off
#SSLProxyCheckPeerName off
#SSLProxyCheckPeerExpire off
</VirtualHost>
```

Datei anzeigen

@ -1,66 +0,0 @@
!!! warning "Wichtig"
Lesen Sie zuerst [die Übersicht](r_p.md).
!!! warning "Warnung"
Dies ist ein nicht unterstützter Communitybeitrag. Korrekturen sind immer erwünscht!
Die Konfiguration von Caddy mit mailcow ist sehr simpel.
In der Caddyfile muss einfach nur ein Bereich für den E-Mailserver angelegt werden.
Bspw:
``` hl_lines="1 3 13"
MAILCOW_HOSTNAME autodiscover.MAILCOW_HOSTNAME autoconfig.MAILCOW_HOSTNAME {
log {
output file /var/log/caddy/MAILCOW_HOSTNAME.log {
roll_disabled
roll_size 512M
roll_uncompressed
roll_local_time
roll_keep 3
roll_keep_for 48h
}
}
reverse_proxy 127.0.0.1:HTTP_BIND
}
```
Dies erlaubt es Caddy automatisch die Zertifikate zu erstellen und den Traffic für diese erwähnten Domains anzunehmen und an mailcow weiterzuleiten.
**Wichtig**: Der ACME Client der mailcow muss deaktiviert sein, da es sonst zu Fehlern seitens mailcow kommt.
Da Caddy sich direkt selbst um die Zertifikate kümmert, können wir mit dem folgenden Skript die Caddy generierten Zertifikate in die mailcow inkludieren:
```bash
#!/bin/bash
MD5SUM_CURRENT_CERT=($(md5sum /opt/mailcow-dockerized/data/assets/ssl/cert.pem))
MD5SUM_NEW_CERT=($(md5sum /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/your.domain.tld/your.domain.tld.crt))
if [ $MD5SUM_CURRENT_CERT != $MD5SUM_NEW_CERT ]; then
cp /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/your.domain.tld/your.domain.tld.crt /opt/mailcow-dockerized/data/assets/ssl/cert.pem
cp /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/your.domain.tld/your.domain.tld.key /opt/mailcow-dockerized/data/assets/ssl/key.pem
postfix_c=$(docker ps -qaf name=postfix-mailcow)
dovecot_c=$(docker ps -qaf name=dovecot-mailcow)
nginx_c=$(docker ps -qaf name=nginx-mailcow)
docker restart ${postfix_c} ${dovecot_c} ${nginx_c}
else
echo "Certs not copied from Caddy (Not needed)"
fi
```
!!! warning "Achtung"
Der Zertifikatspfad von Caddy variiert je nach Installationsart.<br>
Bei diesem Installationsbeispiel wurde Caddy mithilfe des Caddy Repos ([weitere Informationen hier](https://caddyserver.com/docs/install#debian-ubuntu-raspbian)) installiert.<br>
<br>
Um den Caddy Zertifikatspfad auf Ihrem System herauszufinden, genügt ein `find / -name "certificates"`.
Dieses Skript könnte dann als Cronjob jede Stunde aufgerufen werden:
```bash
0 * * * * /bin/bash /path/to/script/deploy-certs.sh >/dev/null 2>&1
```

Datei anzeigen

@ -1,64 +0,0 @@
!!! warning "Important"
First read [the overview](r_p.md).
!!! warning
This is an unsupported community contribution. Feel free to provide fixes.
The configuration of Caddy with mailcow is very simple.
In the caddyfile you just have to create a section for the mailserver.
For example
``` hl_lines="1 3 13"
MAILCOW_HOSTNAME autodiscover.MAILCOW_HOSTNAME autoconfig.MAILCOW_HOSTNAME {
log {
output file /var/log/caddy/MAILCOW_HOSTNAME.log {
roll_disabled
roll_size 512M
roll_uncompressed
roll_local_time
roll_keep 3
roll_keep_for 48h
}
}
reverse_proxy 127.0.0.1:HTTP_BIND
}
```
This allows Caddy to automatically create the certificates and accept traffic for these mentioned domains and forward them to mailcow.
**Important**: The ACME client of mailcow must be disabled, otherwise mailcow will fail.
Since Caddy takes care of the certificates itself, we can use the following script to include the Caddy generated certificates into mailcow:
```bash
#!/bin/bash
MD5SUM_CURRENT_CERT=($(md5sum /opt/mailcow-dockerized/data/assets/ssl/cert.pem))
MD5SUM_NEW_CERT=($(md5sum /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/your.domain.tld/your.domain.tld.crt))
if [ $MD5SUM_CURRENT_CERT != $MD5SUM_NEW_CERT ]; then
cp /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/your.domain.tld/your.domain.tld.crt /opt/mailcow-dockerized/data/assets/ssl/cert.pem
cp /var/lib/caddy/.local/share/caddy/certificates/acme-v02.api.letsencrypt.org-directory/your.domain.tld/your.domain.tld.key /opt/mailcow-dockerized/data/assets/ssl/key.pem
postfix_c=$(docker ps -qaf name=postfix-mailcow)
dovecot_c=$(docker ps -qaf name=dovecot-mailcow)
nginx_c=$(docker ps -qaf name=nginx-mailcow)
docker restart ${postfix_c} ${dovecot_c} ${nginx_c}
else
echo "Certs not copied from Caddy (Not needed)"
fi
```
!!! warning "Attention"
Caddy's certificate path varies depending on the installation type.<br>
In this installation example, Caddy was installed using the Caddy repo ([more informations here](https://caddyserver.com/docs/install#debian-ubuntu-raspbian)).<br>
<br>
To find out the Caddy certificate path on your system, just run a `find / -name "certificates"`.
This script could be called as a cronjob every hour:
```bash
0 * * * * /bin/bash /path/to/script/deploy-certs.sh >/dev/null 2>&1
```

Datei anzeigen

@ -1,19 +0,0 @@
!!! warning "Wichtig"
Lesen Sie zuerst [die Übersicht](r_p.md).
!!! warning "Warnung"
Dies ist ein nicht unterstützter Community Beitrag. Korrekturen sind immer erwünscht!
**Wichtig/Fix erwünscht**: Dieses Beispiel leitet nur HTTPS-Verkehr weiter und benutzt nicht den in mailcow eingebauten ACME-Client.
```
frontend https-in
bind :::443 v4v6 ssl crt mailcow.pem
default_backend mailcow
backend mailcow
option forwardfor
http-request set-header X-Forwarded-Proto https if { ssl_fc }
http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
server mailcow 127.0.0.1:8080 check
```

Datei anzeigen

@ -1,19 +0,0 @@
!!! warning "Important"
First read [the overview](r_p.md).
!!! warning
This is an unsupported community contribution. Feel free to provide fixes.
**Important/Fixme**: This example only forwards HTTPS traffic and does not use mailcows built-in ACME client.
```
frontend https-in
bind :::443 v4v6 ssl crt mailcow.pem
default_backend mailcow
backend mailcow
option forwardfor
http-request set-header X-Forwarded-Proto https if { ssl_fc }
http-request set-header X-Forwarded-Proto http if !{ ssl_fc }
server mailcow 127.0.0.1:8080 check
```

Datei anzeigen

@ -1,60 +0,0 @@
!!! warning "Wichtig"
Lesen Sie zuerst [die Übersicht](r_p.md).
Let's Encrypt folgt unserem Rewrite, Zertifikatsanfragen funktionieren problemlos.
**Achten Sie auf die hervorgehobenen Zeilen**.
``` hl_lines="4 10 12 13 25 39"
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name ZU MAILCOW HOSTNAMEN ÄNDERN autodiscover.* autoconfig.*;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ZU MAILCOW HOSTNAMEN ÄNDERN autodiscover.* autoconfig.*;
ssl_certificate MAILCOW_PATH/data/assets/ssl/cert.pem;
ssl_certificate_key MAILCOW_PATH/data/assets/ssl/key.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
# Siehe https://ssl-config.mozilla.org/#server=nginx für die neuesten Empfehlungen zu ssl-Einstellungen
# Ein Beispiel für eine Konfiguration ist unten angegeben
ssl_protocols TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5:!SHA1:!kRSA;
ssl_prefer_server_ciphers off;
location /Microsoft-Server-ActiveSync {
proxy_pass http://127.0.0.1:8080/Microsoft-Server-ActiveSync;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 75;
proxy_send_timeout 3650;
proxy_read_timeout 3650;
proxy_buffers 64 512k; # Seit dem 2022-04 Update nötig für SOGo
client_body_buffer_size 512k;
client_max_body_size 0;
}
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 0;
# Die folgenden Proxy-Buffer müssen gesetzt werden, wenn Sie SOGo nach dem Update 2022-04 (April 2022) verwenden wollen
# Andernfalls wird ein Login wie folgt fehlschlagen: https://github.com/mailcow/mailcow-dockerized/issues/4537
proxy_buffer_size 128k;
proxy_buffers 64 512k;
proxy_busy_buffers_size 512k;
}
}
```

Datei anzeigen

@ -1,60 +0,0 @@
!!! warning "Important"
First read [the overview](r_p.md).
Let's Encrypt will follow our rewrite, certificate requests will work fine.
**Take care of highlighted lines.**
``` hl_lines="4 10 12 13 25 39"
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name CHANGE_TO_MAILCOW_HOSTNAME autodiscover.* autoconfig.*;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name CHANGE_TO_MAILCOW_HOSTNAME autodiscover.* autoconfig.*;
ssl_certificate MAILCOW_PATH/data/assets/ssl/cert.pem;
ssl_certificate_key MAILCOW_PATH/data/assets/ssl/key.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets off;
# See https://ssl-config.mozilla.org/#server=nginx for the latest ssl settings recommendations
# An example config is given below
ssl_protocols TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5:!SHA1:!kRSA;
ssl_prefer_server_ciphers off;
location /Microsoft-Server-ActiveSync {
proxy_pass http://127.0.0.1:8080/Microsoft-Server-ActiveSync;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_connect_timeout 75;
proxy_send_timeout 3650;
proxy_read_timeout 3650;
proxy_buffers 64 512k; # Needed since the 2022-04 Update for SOGo
client_body_buffer_size 512k;
client_max_body_size 0;
}
location / {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 0;
# The following Proxy Buffers has to be set if you want to use SOGo after the 2022-04 (April 2022) Update
# Otherwise a Login will fail like this: https://github.com/mailcow/mailcow-dockerized/issues/4537
proxy_buffer_size 128k;
proxy_buffers 64 512k;
proxy_busy_buffers_size 512k;
}
}
```

Datei anzeigen

@ -1,105 +0,0 @@
!!! warning "Wichtig"
Lesen Sie zuerst [die Übersicht](r_p.md).
!!! warning "Warnung"
Dies ist ein nicht unterstützter Community Beitrag. Korrekturen sind immer erwünscht!
**Wichtig**: Diese Konfiguration deckt nur das "Reverseproxing" des Webpanels (nginx-mailcow) unter Verwendung von Traefik v2 ab. Wenn Sie auch die Mail-Dienste wie dovecot, postfix... reproxen wollen, müssen Sie die folgende Konfiguration an jeden Container anpassen und einen [EntryPoint](https://docs.traefik.io/routing/entrypoints/) in Ihrer `traefik.toml` oder `traefik.yml` (je nachdem, welche Konfiguration Sie verwenden) für jeden Port erstellen.
In diesem Abschnitt gehen wir davon aus, dass Sie Ihren Traefik 2 `[certificatesresolvers]` in Ihrer Traefik-Konfigurationsdatei richtig konfiguriert haben und auch acme verwenden. Das folgende Beispiel verwendet Lets Encrypt, aber Sie können es gerne auf Ihren eigenen Zertifikatsresolver ändern. Eine grundlegende Traefik 2 toml-Konfigurationsdatei mit allen oben genannten Elementen, die für dieses Beispiel verwendet werden kann, finden Sie hier [traefik.toml](https://github.com/Frenzoid/TraefikBasicConfig/blob/master/traefik.toml), falls Sie eine solche Datei benötigen oder einen Hinweis, wie Sie Ihre Konfiguration anpassen können.
Zuallererst werden wir den acme-mailcow-Container deaktivieren, da wir die von traefik bereitgestellten Zertifikate verwenden werden.
Dazu müssen wir `SKIP_LETS_ENCRYPT=y` in unserer `mailcow.conf` setzen und den folgenden Befehl ausführen, um die Änderungen zu übernehmen:
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker-compose up -d
```
Dann erstellen wir eine `docker-compose.override.yml` Datei, um die Hauptdatei `docker-compose.yml` zu überschreiben, die sich im mailcow-Stammverzeichnis befindet.
```yaml
version: '2.1'
services:
nginx-mailcow:
networks:
# Traefiks Netzwerk hinzufügen
web:
labels:
- traefik.enable=true
# Erstellt einen Router namens "moo" für den Container und richtet eine Regel ein, um den Container mit einer bestimmten Regel zu verknüpfen,
# in diesem Fall eine Host-Regel mit unserer MAILCOW_HOSTNAME-Variable.
- traefik.http.routers.moo.rule=Host(`${MAILCOW_HOSTNAME}`)
# Aktiviert tls über den zuvor erstellten Router.
- traefik.http.routers.moo.tls=true
# Gibt an, welche Art von Cert-Resolver wir verwenden werden, in diesem Fall le (Lets Encrypt).
- traefik.http.routers.moo.tls.certresolver=le
# Erzeugt einen Dienst namens "moo" für den Container und gibt an, welchen internen Port des Containers
# Traefik die eingehenden Daten weiterleiten soll.
- traefik.http.services.moo.loadbalancer.server.port=${HTTP_PORT}
# Gibt an, welchen Eingangspunkt (externer Port) traefik für diesen Container abhören soll.
# Websecure ist Port 443, siehe die Datei traefik.toml wie oben.
- traefik.http.routers.moo.entrypoints=websecure
# Stellen Sie sicher, dass traefik das Web-Netzwerk verwendet, nicht das mailcowdockerized_mailcow-network
- traefik.docker.network=traefik_web
certdumper:
image: humenius/traefik-certs-dumper
command: --restart-containers ${COMPOSE_PROJECT_NAME}-postfix-mailcow-1,${COMPOSE_PROJECT_NAME}-nginx-mailcow-1,${COMPOSE_PROJECT_NAME}-dovecot-mailcow-1
network_mode: none
volumes:
# Binden Sie das Volume, das Traefiks `acme.json' Datei enthält, ein
- acme:/traefik:ro
# SSL-Ordner von mailcow einhängen
- ./data/assets/ssl/:/output:rw
# Binden Sie den Docker Socket ein, damit traefik-certs-dumper die Container neu starten kann
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: always
environment:
# Ändern Sie dies nur, wenn Sie eine andere Domain für mailcows Web-Frontend verwenden als in der Standard-Konfiguration
- DOMAIN=${MAILCOW_HOSTNAME}
networks:
web:
external: true
# Name des externen Netzwerks
name: traefik_web
volumes:
acme:
external: true
# Name des externen Docker Volumes, welches Traefiks `acme.json' Datei enthält
name: traefik_acme
```
Starten Sie die neuen Container mit:
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker-compose up -d
```
Da Traefik 2 ein acme v2 Format verwendet, um ALLE Zertifikaten von allen Domains zu speichern, müssen wir einen Weg finden, die Zertifikate auszulagern. Zum Glück haben wir [diesen kleinen Container] (https://hub.docker.com/r/humenius/traefik-certs-dumper), der die Datei `acme.json` über ein Volume und eine Variable `DOMAIN=example. org`, und damit wird der Container die `cert.pem` und `key.pem` Dateien ausgeben, dafür lassen wir einfach den `traefik-certs-dumper` Container laufen, binden das `/traefik` Volume an den Ordner, in dem unsere `acme.json` gespeichert ist, binden das `/output` Volume an unseren mailcow `data/assets/ssl/` Ordner, und setzen die `DOMAIN=example.org` Variable auf die Domain, von der wir die Zertifikate ausgeben wollen.
Dieser Container überwacht die Datei `acme.json` auf Änderungen und generiert die Dateien `cert.pem` und `key.pem` direkt in `data/assets/ssl/`, wobei der Pfad mit dem `/output`-Pfad des Containers verbunden ist.
Sie können es über die Kommandozeile ausführen oder das [hier](https://hub.docker.com/r/humenius/traefik-certs-dumper) gezeigte docker-compose.yml verwenden.
Nachdem wir die Zertifikate übertragen haben, müssen wir die Konfigurationen aus unseren Postfix- und Dovecot-Containern neu laden und die Zertifikate überprüfen. Wie das geht, sehen Sie [hier](https://mailcow.github.io/mailcow-dockerized-docs/de/post_installation/firststeps-ssl/#ein-eigenes-zertifikat-verwenden).
Und das sollte es gewesen sein 😊, Sie können überprüfen, ob der Traefik-Router einwandfrei funktioniert, indem Sie das Dashboard von Traefik / traefik logs / über https auf die eingestellte Domain zugreifen, oder / und HTTPS, SMTP und IMAP mit den Befehlen auf der zuvor verlinkten Seite überprüfen.

Datei anzeigen

@ -1,108 +0,0 @@
!!! warning "Important"
First read [the overview](r_p.md).
!!! warning
This is an unsupported community contribution. Feel free to provide fixes.
**Important**: This config only covers the "reverseproxing" of the webpannel (nginx-mailcow) using Traefik v2, if you also want to reverseproxy the mail services such as dovecot, postfix... you'll just need to adapt the following config to each container and create an [EntryPoint](https://docs.traefik.io/routing/entrypoints/) on your `traefik.toml` or `traefik.yml` (depending which config you use) for each port.
For this section we'll assume you have your Traefik 2 `[certificatesresolvers]` properly configured on your traefik configuration file, and also using acme, also, the following example uses Lets Encrypt, but feel free to change it to your own cert resolver. You can find a basic Traefik 2 toml config file with all the above implemented which can be used for this example here [traefik.toml](https://github.com/Frenzoid/TraefikBasicConfig/blob/master/traefik.toml) if you need one, or a hint on how to adapt your config.
So, first of all, we are going to disable the acme-mailcow container since we'll use the certs that traefik will provide us.
For this we'll have to set `SKIP_LETS_ENCRYPT=y` on our `mailcow.conf`, and run the following command to apply the changes:
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker-compose up -d
```
Then we'll create a `docker-compose.override.yml` file in order to override the main `docker-compose.yml` found in your mailcow root folder.
```yaml
version: '2.1'
services:
nginx-mailcow:
networks:
# Add Traefik's network
web:
labels:
- traefik.enable=true
# Creates a router called "moo" for the container, and sets up a rule to link the container to certain rule,
# in this case, a Host rule with our MAILCOW_HOSTNAME var.
- traefik.http.routers.moo.rule=Host(`${MAILCOW_HOSTNAME}`)
# Enables tls over the router we created before.
- traefik.http.routers.moo.tls=true
# Specifies which kind of cert resolver we'll use, in this case le (Lets Encrypt).
- traefik.http.routers.moo.tls.certresolver=le
# Creates a service called "moo" for the container, and specifies which internal port of the container
# should traefik route the incoming data to.
- traefik.http.services.moo.loadbalancer.server.port=${HTTP_PORT}
# Specifies which entrypoint (external port) should traefik listen to, for this container.
# websecure being port 443, check the traefik.toml file liked above.
- traefik.http.routers.moo.entrypoints=websecure
# Make sure traefik uses the web network, not the mailcowdockerized_mailcow-network
- traefik.docker.network=traefik_web
certdumper:
image: humenius/traefik-certs-dumper
command: --restart-containers ${COMPOSE_PROJECT_NAME}-postfix-mailcow-1,${COMPOSE_PROJECT_NAME}-nginx-mailcow-1,${COMPOSE_PROJECT_NAME}-dovecot-mailcow-1
network_mode: none
volumes:
# Mount the volume which contains Traefik's `acme.json' file
# Configure the external name in the volume definition
- acme:/traefik:ro
# Mount mailcow's SSL folder
- ./data/assets/ssl/:/output:rw
# Mount docker socket to restart containers
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: always
environment:
# only change this, if you're using another domain for mailcow's web frontend compared to the standard config
- DOMAIN=${MAILCOW_HOSTNAME}
networks:
web:
external: true
# Name of the external network
name: traefik_web
volumes:
acme:
external: true
# Name of the external docker volume which contains Traefik's `acme.json' file
name: traefik_acme
```
Start the new containers with:
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker-compose up -d
```
Now, there's only one thing left to do, which is setup the certs so that the mail services can use them as well, since Traefik 2 uses an acme v2 format to save ALL the license from all the domains we have, we'll need to find a way to dump the certs, lucky we have [this tiny container](https://hub.docker.com/r/humenius/traefik-certs-dumper) which grabs the `acme.json` file through a volume, and a variable `DOMAIN=example.org`, and with these, the container will output the `cert.pem` and `key.pem` files, for this we'll simply run the `traefik-certs-dumper` container binding the `/traefik` volume to the folder where our `acme.json` is saved, bind the `/output` volume to our mailcow `data/assets/ssl/` folder, and set up the `DOMAIN=example.org` variable to the domain we want the certs dumped from.
This container will watch over the `acme.json` file for any changes, and regenerate the `cert.pem` and `key.pem` files directly into `data/assets/ssl/` being the path binded to the container's `/output` path.
You can use the command line to run it, or use the docker-compose.yml shown [here](https://hub.docker.com/r/humenius/traefik-certs-dumper).
After we have the certs dumped, we'll have to reload the configs from our postfix and dovecot containers, and check the certs, you can see how [here](https://mailcow.github.io/mailcow-dockerized-docs/firststeps-ssl/#how-to-use-your-own-certificate).
Aaand that should be it 😊, you can check if the Traefik router works fine through Traefik's dashboard / traefik logs / accessing the setted domain through https, or / and check HTTPS, SMTP and IMAP through the commands shown on the page linked before.

Datei anzeigen

@ -1,93 +0,0 @@
Sie müssen die Nginx-Seite, die mit mailcow: dockerized geliefert wird, nicht ändern.
mailcow: dockerized vertraut auf das Standard-Gateway IP 172.22.1.1 als Proxy.
Stellen Sie sicher, dass Sie HTTP_BIND und HTTPS_BIND in `mailcow.conf` auf eine lokale Adresse ändern und die Ports entsprechend einstellen, zum Beispiel:
``` bash
HTTP_BIND=127.0.0.1
HTTP_PORT=8080
HTTPS_BIND=127.0.0.1
HTTPS_PORT=8443
```
Dadurch werden auch die Bindungen innerhalb des Nginx-Containers geändert! Dies ist wichtig, wenn Sie sich entscheiden, einen Proxy innerhalb von Docker zu verwenden.
**WICHTIG:** Verwenden Sie nicht Port 8081, 9081 oder 65510!
Erzeugen Sie die betroffenen Container neu, indem Sie den folgenden Befehl ausführen:
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker-compose up -d
```
## Wichtige Informationen, bitte lesen Sie diese sorgfältig durch!
!!! info
Wenn Sie planen, einen Reverse-Proxy zu verwenden und einen anderen Servernamen als **MAILCOW_HOSTNAME** verwenden wollen, müssen Sie [Zusätzliche Servernamen für mailcow UI](#hinzufügen-weiterer-servernamen-für-mailcow-ui) hierunter.
!!! warning "Warnung"
Stellen Sie sicher, dass Sie `generate_config.sh` ausführen, bevor Sie die Konfigurationsbeispiele aktivieren.
Das Skript `generate_config.sh` kopiert die Snake-oil Zertifikate an den richtigen Ort, so dass die Dienste nicht aufgrund fehlender Dateien nicht starten können.
!!! warning "Warnung"
Wenn Sie TLS SNI aktivieren (`ENABLE_TLS_SNI` in mailcow.conf), **müssen** die Zertifikatspfade in Ihrem Reverse-Proxy mit den korrekten Pfaden in `data/assets/ssl/{hostname}` übereinstimmen. Die Zertifikate werden in `data/assets/ssl/{hostname1,hostname2,etc}` aufgeteilt und werden daher nicht funktionieren, wenn Sie die Beispiele von unten kopieren, die auf `data/assets/ssl/cert.pem` etc. zeigen.
!!! info
Die Verwendung der Konfigurationsbeispiele wird **acme-Anfragen an mailcow** weiterleiten und es die Zertifikate selbst verwalten lassen.
Der Nachteil der Verwendung von mailcow als ACME-Client hinter einem Reverse-Proxy ist, dass Sie Ihren Webserver neu laden müssen, nachdem acme-mailcow das Zertifikat geändert/erneuert/erstellt hat. Sie können entweder Ihren Webserver täglich neu laden oder ein Skript schreiben, um die Datei auf Änderungen zu überwachen.
Auf vielen Servern wird logrotate den Webserver sowieso täglich neu laden.
Wenn Sie eine lokale Certbot-Installation verwenden möchten, müssen Sie die SSL-Zertifikatsparameter entsprechend ändern.
**Stellen Sie sicher, dass Sie ein Post-Hook-Skript** ausführen, wenn Sie sich entscheiden, externe ACME-Clients zu verwenden. [Ein Beispiel](#optional-post-hook-skript-für-nicht-mailcow-acme-clients) finden Sie hierunter.
Konfigurieren Sie Ihren lokalen Webserver als Reverse Proxy anhand folgender Konfigurationsbeispiele:
- [Apache 2.4](r_p-apache24.md)
- [Nginx](r_p-nginx.md)
- [HAProxy](r_p-haproxy.md)
- [Traefik v2](r_p-traefik2.md)
- [Caddy v2](r_p-caddy2.md)
## Optional: Post-Hook-Skript für nicht-mailcow ACME-Clients
Die Verwendung eines lokalen Certbots (oder eines anderen ACME-Clients) erfordert den Neustart einiger Container, was Sie mit einem Post-Hook-Skript erledigen können.
Stellen Sie sicher, dass Sie die Pfade entsprechend ändern:
```
#!/bin/bash
cp /etc/letsencrypt/live/my.domain.tld/fullchain.pem /opt/mailcow-dockerized/data/assets/ssl/cert.pem
cp /etc/letsencrypt/live/my.domain.tld/privkey.pem /opt/mailcow-dockerized/data/assets/ssl/key.pem
postfix_c=$(docker ps -qaf name=postfix-mailcow)
dovecot_c=$(docker ps -qaf name=dovecot-mailcow)
nginx_c=$(docker ps -qaf name=nginx-mailcow)
docker restart ${postfix_c} ${dovecot_c} ${nginx_c}
```
## Hinzufügen weiterer Servernamen für mailcow UI
Wenn Sie vorhaben, einen Servernamen zu verwenden, der nicht `MAILCOW_HOSTNAME` in Ihrem Reverse-Proxy ist, stellen Sie sicher, dass Sie diesen Namen zuerst in mailcow.conf über `ADDITIONAL_SERVER_NAMES` einpflegen. Die Namen müssen durch Kommas getrennt werden und **dürfen** keine Leerzeichen enthalten. Wenn Sie diesen Schritt überspringen, kann es sein, dass mailcow auf Ihren Reverse-Proxy mit einer falschen Seite antwortet.
```
ADDITIONAL_SERVER_NAMES=webmail.domain.tld,other.example.tld
```
Führen Sie zum Anwenden folgendes aus:
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker-compose up -d
```

Datei anzeigen

@ -1,93 +0,0 @@
You don't need to change the Nginx site that comes with mailcow: dockerized.
mailcow: dockerized trusts the default gateway IP 172.22.1.1 as proxy.
Make sure you change HTTP_BIND and HTTPS_BIND in `mailcow.conf` to a local address and set the ports accordingly, for example:
``` bash
HTTP_BIND=127.0.0.1
HTTP_PORT=8080
HTTPS_BIND=127.0.0.1
HTTPS_PORT=8443
```
This will also change the bindings inside the Nginx container! This is important, if you decide to use a proxy within Docker.
**IMPORTANT:** Do not use port 8081, 9081 or 65510!
Recreate affected containers by running the command:
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker-compose up -d
```
## Important information, please read them carefully!
!!! info
If you plan to use a reverse proxy and want to use another server name that is **not** MAILCOW_HOSTNAME, you need to read [Adding additional server names for mailcow UI](#adding-additional-server-names-for-mailcow-ui) below.
!!! warning
Make sure you run `generate_config.sh` before you enable any site configuration examples.
The script `generate_config.sh` copies snake-oil certificates to the correct location, so the services will not fail to start due to missing files.
!!! warning
If you enable TLS SNI (`ENABLE_TLS_SNI` in mailcow.conf), the certificate paths in your reverse proxy **must** match the correct paths in `data/assets/ssl/{hostname}`. The certificates will be split into `data/assets/ssl/{hostname1,hostname2,etc}` and therefore will not work when you copy the examples from below pointing to `data/assets/ssl/cert.pem` etc.
!!! info
Using the site configuration examples will **forward ACME requests to mailcow** and let it handle certificates itself.
The downside of using mailcow as ACME client behind a reverse proxy is, that you will need to reload your webserver after acme-mailcow changed/renewed/created the certificate. You can either reload your webserver daily or write a script to watch the file for changes.
On many servers logrotate will reload the webserver daily anyway.
If you want to use a local certbot installation, you will need to change the SSL certificate parameters accordingly.
**Make sure you run a post-hook script** when you decide to use external ACME clients. You will find [an example](#optional-post-hook-script-for-non-mailcow-acme-clients) below.
Configure your local webserver as reverse proxy using following configuration examples:
- [Apache 2.4](r_p-apache24.md)
- [Nginx](r_p-nginx.md)
- [HAProxy](r_p-haproxy.md)
- [Traefik v2](r_p-traefik2.md)
- [Caddy v2](r_p-caddy2.md)
## Optional: Post-hook script for non-mailcow ACME clients
Using a local certbot (or any other ACME client) requires to restart some containers, you can do this with a post-hook script.
Make sure you change the paths accordingly:
```
#!/bin/bash
cp /etc/letsencrypt/live/my.domain.tld/fullchain.pem /opt/mailcow-dockerized/data/assets/ssl/cert.pem
cp /etc/letsencrypt/live/my.domain.tld/privkey.pem /opt/mailcow-dockerized/data/assets/ssl/key.pem
postfix_c=$(docker ps -qaf name=postfix-mailcow)
dovecot_c=$(docker ps -qaf name=dovecot-mailcow)
nginx_c=$(docker ps -qaf name=nginx-mailcow)
docker restart ${postfix_c} ${dovecot_c} ${nginx_c}
```
## Adding additional server names for mailcow UI
If you plan to use a server name that is not `MAILCOW_HOSTNAME` in your reverse proxy, make sure to populate that name in mailcow.conf via `ADDITIONAL_SERVER_NAMES` first. Names must be separated by commas and **must not** contain spaces. If you skip this step, mailcow may respond to your reverse proxy with an incorrect site.
```
ADDITIONAL_SERVER_NAMES=webmail.domain.tld,other.example.tld
```
Run the following command to apply:
=== "docker compose (Plugin)"
``` bash
docker compose up -d
```
=== "docker-compose (Standalone)"
``` bash
docker-compose up -d
```

Datei anzeigen

@ -32,7 +32,7 @@ Diese Anleitung basiert auf verschiedenen Schritten:
### DNS-Einrichtung
Der größte Teil der Konfiguration ist in *mailcow*s [DNS Konfiguration](../../prerequisite/prerequisite-dns.de.md) enthalten. Nachdem diese Einrichtung abgeschlossen ist, fügen Sie eine weitere Subdomain für *Mailman* hinzu, z.B. `lists.example.org`, die auf denselben Server zeigt:
Der größte Teil der Konfiguration ist in *mailcow*s [DNS Konfiguration](../../getting-started/prerequisite-dns.de.md) enthalten. Nachdem diese Einrichtung abgeschlossen ist, fügen Sie eine weitere Subdomain für *Mailman* hinzu, z.B. `lists.example.org`, die auf denselben Server zeigt:
```
# Name Typ Wert
@ -90,7 +90,7 @@ certbot certonly -d MAILMAN_DOMAIN
#### Installieren Sie mailcow
Folgen Sie der [mailcow installation](../../i_u_m/i_u_m_install.de.md). **Schritt 5 auslassen und nicht mit starten!**
Folgen Sie der [mailcow installation](../../getting-started/i_u_m_install.de.md). **Schritt 5 auslassen und nicht mit starten!**
#### mailcow konfigurieren
@ -212,7 +212,7 @@ version: '2'
services:
mailman-core:
environment:
- DATABASE_URL=postgresql://mailman:DBPASS@database/mailmandb
- DATABASE_URL=postgres://mailman:DBPASS@database/mailmandb
- HYPERKITTY_API_KEY=HYPERKITTY_KEY
- TZ=Europe/Berlin
- MTA=postfix
@ -222,7 +222,7 @@ services:
mailman-web:
environment:
- DATABASE_URL=postgresql://mailman:DBPASS@database/mailmandb
- DATABASE_URL=postgres://mailman:DBPASS@database/mailmandb
- HYPERKITTY_API_KEY=HYPERKITTY_KEY
- TZ=Europe/Berlin
- SECRET_KEY=DJANGO_KEY
@ -328,13 +328,13 @@ Wenn man eine neue Liste anlegt und versucht, sofort eine E-Mail zu versenden, a
## Update
**mailcow** hat sein eigenes Update-Skript in `/opt/mailcow-dockerized/update.sh`, [siehe die Dokumentation](../../i_u_m/i_u_m_update.de.md).
**mailcow** hat sein eigenes Update-Skript in `/opt/mailcow-dockerized/update.sh`, [siehe die Dokumentation](../../getting-started/i_u_m_update.de.md).
Für **Mailman** holen Sie sich einfach die neueste Version aus dem [github repository](https://github.com/maxking/docker-mailman).
## Sicherung
**mailcow** hat ein eigenes Backup-Skript. [Lies die Docs](../../backup_restore/b_n_r-backup.de.md) für weitere Informationen.
**mailcow** hat ein eigenes Backup-Skript. [Lies die Docs](../../backup_restore_migrate/b_r_m-backup.de.md) für weitere Informationen.
**Mailman** gibt keine Backup-Anweisungen in der README.md an. Im [gitbucket von pgollor](https://gitbucket.pgollor.de/docker/mailman-mailcow-integration/blob/master/mailman-backup.sh) befindet sich ein Skript, das hilfreich sein könnte.

Datei anzeigen

@ -32,7 +32,7 @@ This guide is based on different steps:
### DNS setup
Most of the configuration is covered by *mailcow*s [DNS setup](../../prerequisite/prerequisite-dns.en.md). After finishing this setup add another subdomain for *Mailman*, e.g. `lists.example.org` that points to the same server:
Most of the configuration is covered by *mailcow*s [DNS setup](../../getting-started/prerequisite-dns.en.md). After finishing this setup add another subdomain for *Mailman*, e.g. `lists.example.org` that points to the same server:
```
# Name Type Value
@ -91,7 +91,7 @@ certbot certonly -d MAILMAN_DOMAIN
#### Install mailcow
Follow the [mailcow installation](../../i_u_m/i_u_m_install.en.md). **Omit step 5 and do not pull and start!**
Follow the [mailcow installation](../../getting-started/i_u_m_install.en.md). **Omit step 5 and do not pull and start!**
#### Configure mailcow
@ -212,7 +212,7 @@ version: '2'
services:
mailman-core:
environment:
- DATABASE_URL=postgresql://mailman:DBPASS@database/mailmandb
- DATABASE_URL=postgres://mailman:DBPASS@database/mailmandb
- HYPERKITTY_API_KEY=HYPERKITTY_KEY
- TZ=Europe/Berlin
- MTA=postfix
@ -222,7 +222,7 @@ services:
mailman-web:
environment:
- DATABASE_URL=postgresql://mailman:DBPASS@database/mailmandb
- DATABASE_URL=postgres://mailman:DBPASS@database/mailmandb
- HYPERKITTY_API_KEY=HYPERKITTY_KEY
- TZ=Europe/Berlin
- SECRET_KEY=DJANGO_KEY
@ -329,13 +329,13 @@ When you create a new list and try to immediately send an e-mail, *postfix* resp
## Update
**mailcow** has it's own update script in `/opt/mailcow-dockerized/update.sh`, [see the docs](../../i_u_m/i_u_m_update.en.md).
**mailcow** has it's own update script in `/opt/mailcow-dockerized/update.sh`, [see the docs](../../getting-started/i_u_m_update.en.md).
For **Mailman** just fetch the newest version from the [github repository](https://github.com/maxking/docker-mailman).
## Backup
**mailcow** has an own backup script. [Read the docs](../../backup_restore/b_n_r-backup.en.md) for further informations.
**mailcow** has an own backup script. [Read the docs](../../backup_restore_migrate/b_r_m-backup.en.md) for further informations.
**Mailman** won't state backup instructions in the README.md. In the [gitbucket of pgollor](https://gitbucket.pgollor.de/docker/mailman-mailcow-integration/blob/master/mailman-backup.sh) is a script that may be helpful.

Datei anzeigen

@ -1,375 +1,206 @@
## Installation von Roundcube
Sofern nicht abweichend angegeben wird für alle aufgeführten Kommandos angenommen, dass diese im mailcow
Installationsverzeichnis ausgeführt werden, d. h. dem Verzeichnis, welches `mailcow.conf` usw. enthält. Bitte führen Sie
die Kommandos nicht blind aus, sondern verstehen Sie was diese bewirken. Keines der Kommandos sollte einen Fehler
ausgeben; sollten Sie dennoch auf einen Fehler stoßen, beheben Sie diesen sofern notwendig bevor Sie mit den
nachfolgenden Kommandos fortfahren.
### Hinweise zur Verwendung von composer
Diese Anweisungen verwenden das Programm composer zur Aktualisierung der Abhängigkeiten von Roundcube und um
Roundcube-Plugins zu installieren bzw. zu aktualisieren.
Das roundcube-plugin-installer composer Plugin hat eine [Design-Schwäche](https://github.com/roundcube/plugin-installer/issues/38),
die dazu führen kann, dass composer bei Operationen fehlschlägt, im Rahmen derer Pakete aktualisiert oder deinstalliert
werden.
Die Fehlermeldung in diesem Falle besagt, dass eine `require`-Anweisung in `autoload_real.php` fehlgeschlagen ist, weil
eine Datei nicht gefunden werden konnte. Beispiel:
```
In autoload_real.php line 43:
require(/web/rc/vendor/composer/../guzzlehttp/promises/src/functions_include.php): Failed to open stream: No such file or directory
```
Leider treten diese Fehler relativ häufig auf, sie lassen sich jedoch leicht beheben indem der Autoloader aktualisiert
wird und das fehlgeschlagene Kommando im Anschluss erneut ausgeführt wird:
Laden Sie Roundcube 1.6.x in das Web htdocs Verzeichnis herunter und entpacken Sie es (hier `rc/`):
```bash
docker exec -it -w /web/rc $(docker ps -f name=php-fpm-mailcow -q) composer dump-autoload -o
# Nun das fehlgeschlagene Kommando erneut ausführen
# Prüfen Sie, ob eine neuere Version vorliegt!
cd data/web
wget -O - https://github.com/roundcube/roundcubemail/releases/download/1.6.1/roundcubemail-1.6.1-complete.tar.gz | tar xfvz -
# Ändern Sie den Ordnernamen
mv roundcubemail-1.6.1 rc
# Berechtigungen ändern
chown -R root: rc/
```
### Vorbereitung
Zunächst laden wir `mailcow.conf` um Zugriff auf die mailcow-Einstellungen innerhalb der nachfolgenden Kommandos zu
erhalten.
```bash
source mailcow.conf
```
Laden Sie Roundcube 1.6.x (prüfen Sie das aktuellste Release und passen Sie die URL entsprechend an) in das web
Verzeichnis herunter und entpacken Sie es (hier `rc/`):
```bash
mkdir -m 755 data/web/rc
wget -O - https://github.com/roundcube/roundcubemail/releases/download/1.6.1/roundcubemail-1.6.1-complete.tar.gz | tar -xvz --no-same-owner -C data/web/rc --strip-components=1 -f -
docker exec -it $(docker ps -f name=php-fpm-mailcow -q) chown www-data:www-data /web/rc/logs /web/rc/temp
docker exec -it $(docker ps -f name=php-fpm-mailcow -q) chown root:www-data /web/rc/config
docker exec -it $(docker ps -f name=php-fpm-mailcow -q) chmod 750 /web/rc/logs /web/rc/temp /web/rc/config
```
### Optional: Rechtschreibprüfung
Wenn Sie eine Rechtschreibprüfung benötigen, erstellen Sie eine Datei `data/hooks/phpfpm/aspell.sh` mit folgendem Inhalt
und geben Sie dann `chmod +x data/hooks/phpfpm/aspell.sh` ein. Dadurch wird eine lokale Rechtschreibprüfung installiert.
Beachten Sie, dass die meisten modernen Webbrowser eine eingebaute Rechtschreibprüfung haben, so dass Sie diese
vielleicht nicht benötigen.
Wenn Sie eine Rechtschreibprüfung benötigen, erstellen Sie eine Datei `data/hooks/phpfpm/aspell.sh` mit folgendem Inhalt und geben Sie dann `chmod +x data/hooks/phpfpm/aspell.sh` ein. Dadurch wird eine lokale Rechtschreibprüfung installiert. Beachten Sie, dass die meisten modernen Webbrowser eine eingebaute Rechtschreibprüfung haben, so dass Sie diese vielleicht nicht benötigen.
```bash
#!/bin/bash
apk update
apk add aspell-de # oder jede andere Sprache
```
### Installation des MIME-Typ-Verzeichnisses
Laden Sie die `mime.types` Datei herunter, da diese nicht im `php-fpm`-Container enthalten ist.
```bash
wget -O data/web/rc/config/mime.types http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
```
### Anlegen der Roundcube-Datenbank
Erstellen Sie eine Datenbank für Roundcube im mailcow mysql Container. Dies erstellt einen neuen `roundcube`
Datenbank-Benutzer mit einem Zufallspasswort, welches in die Shell ausgegeben wird und in einer Shell-Variable für die
Verwendung durch die nachfolgenden Kommandos gespeichert wird. Beachten Sie, dass Sie die `DBROUNDCUBE`-Shell-Variable
manuell auf das ausgegebene Passwort setzen müssen, falls sie den Installationsprozess unterbrechen und später in einer
neuen Shell fortsetzen sollten.
```bash
DBROUNDCUBE=$(LC_ALL=C </dev/urandom tr -dc A-Za-z0-9 2> /dev/null | head -c 28)
echo Das Datenbank-Password für den Benutzer roundcube lautet $DBROUNDCUBE
docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -e "CREATE DATABASE roundcubemail CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -e "CREATE USER 'roundcube'@'%' IDENTIFIED BY '${DBROUNDCUBE}';"
docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -e "GRANT ALL PRIVILEGES ON roundcubemail.* TO 'roundcube'@'%';"
```
### Roundcube-Konfigurationsdatei
Erstellen Sie eine Datei `data/web/rc/config/config.inc.php` mit dem folgenden Inhalt.
- Die `des_key`-Einstellung wird auf einen Zufallswert gesetzt. Sie wird u. a. zur Verschlüsselung vorübergehend
gespeicherter IMAP-Passwörter verwendet.
- Die Liste der Plugins kann nach Belieben angepasst werden. Die folgende Liste enthält eine Liste von
Standard-Plugins, welche ich als allgemein nützlich empfinde und die gut mit mailcow zusammenspielen:
- Das archive-Plugin fügt einen Archiv-Button hinzu, der ausgewählte E-Mails in ein konfigurierbares
Archiv-Verzeichnis verschiebt.
- Das managesieve-Plugin bietet eine benutzerfreundliche Oberfläche zur Verwaltung serverseitiger E-Mail-Filter und
Abwesenheits-Benachrichtigungen.
- Das acl-Plugin ermöglicht die Verwaltung von Zugriffskontroll-Listen auf IMAP-Verzeichnissen, mit der Möglichkeit
IMAP-Verzeichnisse mit anderen Benutzern zu teilen.
- Das markasjunk-Plugin fügt Buttons hinzu, um ausgewählte E-Mails als Spam (oder E-Mails im Junk-Verzeichnis nicht
als Spam) zu markieren und diese in das Junk-Verzeichnis (oder zurück in den Posteingang) zu verschieben. Die in
mailcow enthaltenen Sieve-Filter lösen automatisch die zugehörige Lern-Operation in rspamd aus, so dass keine
weitere Konfiguration des Plugins erforderlich ist.
- Das zipdownload-Plugin erlaubt es, mehrere E-Mail-Anhänge oder E-Mails als ZIP-Archiv herunterzuladen.
- Wenn Sie die Rechtschreibprüfung im obigen Schritt nicht installiert haben, entfernen Sie den Parameter
`spellcheck_engine`.
```bash
cat <<EOCONFIG >data/web/rc/config/config.inc.php
<?php
\$config['db_dsnw'] = 'mysql://roundcube:${DBROUNDCUBE}@mysql/roundcubemail';
\$config['imap_host'] = 'dovecot:143';
\$config['smtp_host'] = 'postfix:588';
\$config['smtp_user'] = '%u';
\$config['smtp_pass'] = '%p';
\$config['support_url'] = '';
\$config['product_name'] = 'Roundcube Webmail';
\$config['cipher_method'] = 'chacha20-poly1305';
\$config['des_key'] = '$(LC_ALL=C </dev/urandom tr -dc "A-Za-z0-9 !#$%&()*+,-./:;<=>?@[\\]^_{|}~" 2> /dev/null | head -c 32)';
\$config['plugins'] = [
'archive',
'managesieve',
'acl',
'markasjunk',
'zipdownload',
];
\$config['spellcheck_engine'] = 'aspell';
\$config['mime_types'] = '/web/rc/config/mime.types';
\$config['enable_installer'] = true;
\$config['managesieve_host'] = 'dovecot:4190';
// Enables separate management interface for vacation responses (out-of-office)
// 0 - no separate section (default); 1 - add Vacation section; 2 - add Vacation section, but hide Filters section
\$config['managesieve_vacation'] = 1;
EOCONFIG
docker exec -it $(docker ps -f name=php-fpm-mailcow -q) chown root:www-data /web/rc/config/config.inc.php
docker exec -it $(docker ps -f name=php-fpm-mailcow -q) chmod 640 /web/rc/config/config.inc.php
```
### Initialisierung der Datenbank
Richten Sie Ihren Browser auf `https://myserver/rc/installer`. Prüfen Sie, dass die Webseite in keinem der Schritte "NOT
OK"-Testergebnisse zeigt. Einige "NOT AVAILABLE"-Testergebnisse sind bzgl. der verschiedenen Datenbank-Erweiterungen
erwartet, von denen nur MySQL benötigt wird.
Initialisieren Sie die Datenbank und verlassen Sie das Installationsprogramm. Es ist nicht notwendig, die
Konfigurationsdatei mit der heruntergeladenen Datei zu aktualisieren, sofern Sie keine Änderungen an den Einstellungen
innerhalb des Installationsprogramms durchgeführt habe, die Sie übernehmen möchten.
### Webserver-Konfiguration
Das Roundcube-Verzeichnis enthält einige Inhalte, die nicht an Web-Nutzer ausgeliefert werden sollen. Wir erstellen
daher eine Konfigurations-Ergänzung für nginx, um nur die öffentlichen Teile von Roundcube im Web zu exponieren:
```bash
cat <<EOCONFIG >data/conf/nginx/site.roundcube.custom
location /rc/ {
alias /web/rc/public_html/;
}
EOCONFIG
```
### Deaktivieren und entfernen des Installationsprogramms
Löschen Sie das Verzeichnis `data/web/rc/installer` nach einer erfolgreichen Installation, und setzen Sie die
`enable_installer`-Option in `data/web/rc/config/config.inc.php` auf `false`:
```bash
rm -r data/web/rc/installer
sed -i -e "s/\(\$config\['enable_installer'\].* = \)true/\1false/" data/web/rc/config/config.inc.php
```
### Aktualisierung der Roundcube-Abhängigkeiten
Dieser Schritt ist nicht unbedingt notwendig, aber zumindest zum Zeitpunkt der Erstellung dieser Anweisungen enthielten
die mit Roundcube ausgelieferten Abhängigkeiten Versionen mit Sicherheitslücken, daher könnte es eine gute Idee sein,
die Abhängigkeiten auf die neusten Versionen zu aktualisieren. Aus demselben Grund sollte composer update hin und wieder
ausgeführt werden.
```bash
cp -n data/web/rc/composer.json-dist data/web/rc/composer.json
docker exec -it -w /web/rc $(docker ps -f name=php-fpm-mailcow -q) composer update --no-dev -o
```
Sie können außerdem `composer audit` verwenden, um bekannte Sicherheitslücken in den installierten composer-Paketen
anzuzeigen.
```bash
docker exec -it -w /web/rc $(docker ps -f name=php-fpm-mailcow -q) composer audit
```
### Ermöglichen der Klartext-Authentifizierung für den php-fpm-Container ohne die Verwendung von TLS
Wir müssen die Verwendung von Klartext-Authentifizierung über nicht verschlüsselte Verbindungen (innerhalb der
Container-Netzwerks) in Dovecot zulassen, was in der Standard-Installation von mailcow nur für den SOGo-Container
zum gleichen Zweck möglich ist. Danach starten Sie den Dovecot-Container neu, damit die Änderung wirksam wird.
```bash
cat <<EOCONFIG >>data/conf/dovecot/extra.conf
remote ${IPV4_NETWORK}.0/24 {
disable_plaintext_auth = no
}
remote ${IPV6_NETWORK} {
disable_plaintext_auth = no
}
EOCONFIG
docker compose restart dovecot-mailcow
```
### Ofelia-Job für Roundcube-Aufräumtätigkeiten
Roundcube muss regelmässig die Datenbank von nicht mehr benötigter Information befreien. Wir legen einen Ofelia-Job an,
der das Roundcube `cleandb.sh`-Skript regelmässig ausführt.
Um dies zu tun, fügen Sie folgendes zu `docker-compose.override.yml` hinzu (falls Sie bereits einige Anpassungen für den
php-fpm-Container durchgeführt haben, fügen Sie die Label dem bestehenden Abschnitt hinzu):
```yml
version: '2.1'
services:
php-fpm-mailcow:
labels:
ofelia.enabled: "true"
ofelia.job-exec.roundcube_cleandb.schedule: "@every 168h"
ofelia.job-exec.roundcube_cleandb.user: "www-data"
ofelia.job-exec.roundcube_cleandb.command: "/bin/bash -c \"[ -f /web/rc/bin/cleandb.sh ] && /web/rc/bin/cleandb.sh\""
```
## Optionale Zusatz-Funktionalitäten
## Aktivieren der Funktion "Passwort ändern" in Roundcube
Das Ändern des mailcow Passworts aus der Roundcube-Benutzeroberfläche wird durch das password-Plugin ermöglicht. Wir
konfigurieren dieses zur Verwendung der mailcow-API zur Passwort-Aktualisierung, was es zunächst erfordert, die API zu
aktivieren und den API-Schlüssel zu ermitteln (Lese-/Schreib-Zugriff notwendig). Die API kann in der
mailcow-Administrationsoberfläche aktiviert werden, wo Sie auch den API-Schlüssel finden.
Öffnen Sie `data/web/rc/config/config.inc.php` und aktivieren Sie das Passwort-Plugin, indem Sie es dem
`$config['plugins']`-Array hinzufügen, zum Beispiel:
- **Ändern Sie den Parameter `des_key` auf einen Zufallswert.** Er wird verwendet, um Ihr IMAP-Passwort vorübergehend zu speichern.
- Der `db_prefix` ist optional, wird aber empfohlen.
- Wenn Sie die Rechtschreibprüfung im obigen Schritt nicht installiert haben, entfernen Sie den Parameter `spellcheck_engine` und ersetzen ihn durch `$config['enable_spellcheck'] = false;`.
```php
<?php
error_reporting(0);
if (!file_exists('/tmp/mime.types')) {
file_put_contents("/tmp/mime.types", fopen("http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types", 'r'));
}
$config = array();
$config['db_dsnw'] = 'mysql://' . getenv('DBUSER') . ':' . getenv('DBPASS') . '@mysql/' . getenv('DBNAME');
$config['imap_host'] = 'tls://dovecot:143';
$config['smtp_host'] = 'tls://postfix:587';
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['support_url'] = '';
$config['product_name'] = 'Roundcube Webmail';
$config['des_key'] = 'yourrandomstring_changeme';
$config['log_dir'] = '/dev/null';
$config['temp_dir'] = '/tmp';
$config['plugins'] = array(
'archive',
'managesieve',
'acl',
'markasjunk',
'zipdownload',
'password',
'managesieve'
);
$config['spellcheck_engine'] = 'aspell';
$config['mime_types'] = '/tmp/mime.types';
$config['imap_conn_options'] = array(
'ssl' => array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true)
);
$config['enable_installer'] = true;
$config['smtp_conn_options'] = array(
'ssl' => array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true)
);
$config['db_prefix'] = 'mailcow_rc1';
```
Konfigurieren Sie das password-Plugin (stellen Sie sicher, __\*\*API_KEY\*\*__ auf Ihren mailcow Lese-/Schreib-API-Schlüssel
anzupassen):
Richten Sie Ihren Browser auf `https://myserver/rc/installer` und folgen Sie den Anweisungen.
Initialisiere die Datenbank und verlasse das Installationsprogramm.
```bash
cat <<EOCONFIG >data/web/rc/plugins/password/config.inc.php
<?php
\$config['password_driver'] = 'mailcow';
\$config['password_confirm_current'] = true;
\$config['password_mailcow_api_host'] = 'http://nginx';
\$config['password_mailcow_api_token'] = '**API_KEY**';
EOCONFIG
**Löschen Sie das Verzeichnis `data/web/rc/installer` nach einer erfolgreichen Installation!**
## Konfigurieren Sie die ManageSieve-Filterung
Öffnen Sie `data/web/rc/config/config.inc.php` und ändern Sie die folgenden Parameter (oder fügen Sie sie am Ende der Datei hinzu):
```php
$config['managesieve_host'] = 'tls://dovecot:4190';
$config['managesieve_conn_options'] = array(
'ssl' => array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true)
);
// Aktiviert separate Verwaltungsschnittstelle für Urlaubsantworten (außer Haus)
// 0 - kein separater Abschnitt (Standard),
// 1 - Abschnitt "Urlaub" hinzufügen,
// 2 - Abschnitt "Urlaub" hinzufügen, aber Abschnitt "Filter" ausblenden
$config['managesieve_vacation'] = 1;
```
Hinweis: Sollten Sie die mailcow nginx-Konfiguration so angepasst haben, dass http-Anfragen auf https umgeleitet werden
(wie z. B. [hier](https://docs.mailcow.email/manual-guides/u_e-80_to_443/) beschrieben), dann wird die direkte
Verbindung zum nginx-Container via HTTP nicht funktionieren, da nginx kein im Zertifikat enthaltener Hostname ist. In
solchen Fällen setzen Sie `password_mailcow_api_host` stattdessen auf die öffentliche URI:
## Aktivieren Sie die Funktion "Passwort ändern" in Roundcube
```bash
cat <<EOCONFIG >data/web/rc/plugins/password/config.inc.php
<?php
\$config['password_driver'] = 'mailcow';
\$config['password_confirm_current'] = true;
\$config['password_mailcow_api_host'] = 'https://${MAILCOW_HOSTNAME}';
\$config['password_mailcow_api_token'] = '**API_KEY**';
EOCONFIG
```
## CardDAV-Adressbücher in Roundcube einbinden
Installieren Sie die neuste v5-Version (die untenstehende Konfiguration ist kompatibel zu v5-Releases) mit composer.
Antworten Sie `Y`, wenn Sie gefragt werden, ob Sie das Plugin aktivieren möchten.
```bash
docker exec -it -w /web/rc $(docker ps -f name=php-fpm-mailcow -q) composer require --update-no-dev -o "roundcube/carddav:~5"
```
Editieren Sie die Datei `data/web/rc/plugins/carddav/config.inc.php` und fügen Sie folgenden Inhalt hinzu:
```bash
cat <<EOCONFIG >data/web/rc/plugins/carddav/config.inc.php
<?php
\$prefs['_GLOBAL']['pwstore_scheme'] = 'des_key';
\$prefs['SOGo'] = [
'accountname' => 'SOGo',
'username' => '%u',
'password' => '%p',
'discovery_url' => 'http://sogo:20000/SOGo/dav/',
'name' => '%N',
'use_categories' => true,
'fixed' => ['username', 'password'],
];
EOCONFIG
```
RCMCardDAV legt alle Adressbücher des Benutzers beim Login in Roundcube an, einschließlich __abonnierten__ Adressbüchern
die mit dem Benutzers von anderen Benutzern geteilt werden.
Wenn Sie das Standard-Adressbuch (gespeichert in der Roundcube-Datenbank) entfernen möchten, so dass nur
CardDAV-Adressbücher verwendet werden können, fügen Sie der Konfigurationsdatei `data/web/rc/config/config.inc.php` die
Option `$config['address_book_type'] = '';` hinzu.
Hinweis: RCMCardDAV verwendet zusätzliche Datenbank-Tabellen. Nach der Installation (oder Aktualisierung) von RCMCardDAV
ist es notwendig, sich in Roundcube neu anzumelden (melden Sie sich vorher ab, wenn Sie bereits eingeloggt sind), da die
Erzeugung der Datenbank-Tabellen bzw. Änderungen nur bei der Anmeldung in Roundcube durchgeführt werden.
### Übermittlung der Client-Netzwerkadresse an Dovecot
Normalerweise sieht der IMAP-Server Dovecot die Netzwerkadresse des php-fpm-Containers wenn Roundcube zu diesem
Verbindungen aufbaut. Durch Verwendung einer IMAP-Erweiterung und dem `roundcube-dovecot_client_ip` Roundcube-Plugin ist
es möglich, dass Roundcube Dovecot die Client-Netzwerkadresse übermittelt, so dass in den Log-Dateien die
Client-Netzwerkadresse erscheint. Dies führt dazu, dass Login-Versuche an Roundcube in den Dovecot-Logs genauso wie
direkte Client-Verbindungen zu Dovecot aufgezeichnet werden, und fehlgeschlagene Login-Versuche an Roundcube
analog zu fehlgeschlagenen direkten IMAP-Logins durch den netfilter-Container oder andere ggf. verfügbare Mechanismen
zur Behandlung von Bruteforce-Attacken auf den IMAP-Server aufgegriffen werden und z. B. zu einer Blockierung des
Clients führen.
Hierzu muss das Roundcube-Plugin installiert werden:
```bash
docker exec -it -w /web/rc $(docker ps -f name=php-fpm-mailcow -q) composer require --update-no-dev -o "takerukoushirou/roundcube-dovecot_client_ip:~1"
```
Weiterhin müssen wir Dovecot konfigurieren, so dass der php-fpm-Container als Teil eines vertrauenswürdigen Netzwerks
betrachtet wird und somit die Client-Netzwerkadresse innerhalb einer IMAP-Sitzung überschreiben darf. Beachten Sie, dass
dies auch die Klartext-Authentifizierung für die aufgeführten Netzwerkbereiche erlaubt, so dass das explizite
Überschreiben von `disable_plaintext_auth` weiter oben in diesem Fall nicht notwendig ist.
```bash
cat <<EOCONFIG >>data/conf/dovecot/extra.conf
login_trusted_networks = ${IPV4_NETWORK}.0/24 ${IPV6_NETWORK}
EOCONFIG
docker compose restart dovecot-mailcow
```
### Roundcube zur mailcow Apps-Liste hinzufügen
Optional können Sie Roundcubes Link zu der mailcow Apps Liste hinzufügen.
Um dies zu tun, öffnen oder erstellen Sie `data/web/inc/vars.local.inc.php` und stellen Sie sicher, dass es den
folgenden Konfigurationsblock beinhaltet:
Öffnen Sie `data/web/rc/config/config.inc.php` und aktivieren Sie das Passwort-Plugin:
```php
<?php
$MAILCOW_APPS = [
[
'name' => 'SOGo',
'link' => '/SOGo/'
],
[
'name' => 'Roundcube',
'link' => '/rc/'
]
];
[...]
$config['plugins'] = array(
'archive',
'password',
);
[...]
```
### Administratoren ohne Passwort in Roundcube einloggen lassen
Öffnen Sie `data/web/rc/plugins/password/password.php`, suchen Sie nach `case 'ssha':` und fügen Sie oben hinzu:
```php
case 'ssha256':
$salt = rcube_utils::random_bytes(8);
$crypted = base64_encode( hash('sha256', $password . $salt, TRUE ) . $salt );
$prefix = '{SSHA256}';
break;
```
Öffnen Sie `data/web/rc/plugins/password/config.inc.php` und ändern Sie die folgenden Parameter (oder fügen Sie sie am Ende der Datei hinzu):
```php
$config['password_driver'] = 'sql';
$config['password_algorithm'] = 'ssha256';
$config['password_algorithm_prefix'] = '{SSHA256}';
$config['password_query'] = "UPDATE mailbox SET password = %P WHERE username = %u";
```
## CardDAV Adressbücher in Roundcube einbinden
Laden Sie die neueste Version von [RCMCardDAV](https://github.com/mstilkerich/rcmcarddav) in das Roundcube Plugin Verzeichnis und entpacken Sie es (hier `rc/plugins`):
```bash
cd data/web/rc/plugins
wget -O - https://github.com/mstilkerich/rcmcarddav/releases/download/v4.4.1/carddav-v4.4.1-roundcube16.tar.gz | tar xfvz -
chown -R root: carddav/
```
Kopieren Sie die Datei `config.inc.php.dist` nach `config.inc.php` (hier in `rc/plugins/carddav`) und fügen Sie die folgende Voreinstellung an das Ende der Datei an - vergessen Sie nicht, `mx.example.org` durch Ihren eigenen Hostnamen zu ersetzen:
```php
$prefs['SOGo'] = array(
'name' => 'SOGo',
'username' => '%u',
'password' => '%p',
'url' => 'https://mx.example.org/SOGo/dav/%u/',
'carddav_name_only' => true,
'use_categories' => true,
'active' => true,
'readonly' => false,
'refresh_time' => '02:00:00',
'fixed' => array( 'active', 'name', 'username', 'password', 'refresh_time' ),
'hide' => false,
);
```
Bitte beachten Sie, dass dieses Preset nur das Standard-Adressbuch integriert (dasjenige, das den Namen "Persönliches Adressbuch" trägt und nicht gelöscht werden kann). Weitere Adressbücher werden derzeit nicht automatisch erkannt, können aber manuell in den Roundcube-Einstellungen hinzugefügt werden.
Aktivieren Sie das Plugin, indem Sie `carddav` zu `$config['plugins']` in `rc/config/config.inc.php` hinzufügen.
Wenn Sie die Standard-Adressbücher (die in der Roundcube-Datenbank gespeichert sind) entfernen möchten, so dass nur die CardDAV-Adressbücher zugänglich sind, fügen Sie `$config['address_book_type'] = '';` in die Konfigurationsdatei `data/web/rc/config/config.inc.php` ein.
---
Optional können Sie Roundcube's Link zu der mailcow Apps Liste hinzufügen.
Um dies zu tun, öffnen oder erstellen Sie `data/web/inc/vars.local.inc.php` und fügen Sie den folgenden Code-Block hinzu:
*HINWEIS: Vergessen Sie nicht, das `<?php` Trennzeichen in der ersten Zeile einzufügen*
```php
...
$MAILCOW_APPS = array(
array(
'name' => 'SOGo',
'link' => '/SOGo/'
),
array(
'name' => 'Roundcube',
'link' => '/rc/'
)
);
...
```
## Aktualisierung von Roundcube
Ein Upgrade von Roundcube ist recht einfach: Gehen Sie auf die [Github releases](https://github.com/roundcube/roundcubemail/releases) Seite für Roundcube und holen Sie sich den Link für die "complete.tar.gz" Datei für die gewünschte Version. Dann folgen Sie den untenstehenden Befehlen und ändern Sie die URL und den Namen des Roundcube-Ordners, falls nötig.
```bash
# Starten Sie eine Bash-Sitzung des mailcow PHP-Containers
docker exec -it mailcowdockerized-php-fpm-mailcow-1 bash
# Installieren Sie die erforderliche Upgrade-Abhängigkeit, dann aktualisieren Sie Roundcube auf die gewünschte Version
apk add rsync
cd /tmp
wget -O - https://github.com/roundcube/roundcubemail/releases/download/1.6.1/roundcubemail-1.6.1-complete.tar.gz | tar xfvz -
cd roundcubemail-1.6.1
bin/installto.sh /web/rc
# Geben Sie 'Y' ein und drücken Sie die Eingabetaste, um Ihre Installation von Roundcube zu aktualisieren.
# Geben Sie 'N' ein, wenn folgender Dialog erscheint: "Do you want me to fix your local configuration".
# Sollte im Output eine Notice kommen "NOTICE: Update dependencies by running php composer.phar update --no-dev" sollte an kurzerhand composer.phar downloaden und die updates durchführen:
cd /web/rc
wget https://getcomposer.org/download/2.4.2/composer.phar
php composer.phar update --no-dev
# Auf die Frage "Do you trust "roundcube/plugin-installer" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] " bitte mit y antworten.
# Entfernen Sie übrig gebliebene Dateien
cd /tmp
rm -rf roundcube*
# Falls Sie von Version 1.5 auf 1.6 updaten, dann führen Sie folgende Befehle aus, um die Konfigurationsdatei anzupassen:`
sed -i "s/\$config\['default_host'\].*$/\$config\['imap_host'\]\ =\ 'tls:\/\/dovecot:143'\;/" /web/rc/config/config.inc.php
sed -i "/\$config\['default_port'\].*$/d" /web/rc/config/config.inc.php
sed -i "s/\$config\['smtp_server'\].*$/\$config\['smtp_host'\]\ =\ 'tls:\/\/postfix:587'\;/" /web/rc/config/config.inc.php
sed -i "/\$config\['smtp_port'\].*$/d" /web/rc/config/config.inc.php
sed -i "s/\$config\['managesieve_host'\].*$/\$config\['managesieve_host'\]\ =\ 'tls:\/\/dovecot:4190'\;/" /web/rc/config/config.inc.php
sed -i "/\$config\['managesieve_port'\].*$/d" /web/rc/config/config.inc.php
```
## Administratoren ohne Passwort in Roundcube einloggen lassen
Installieren Sie zunächst das Plugin [dovecot_impersonate](https://github.com/corbosman/dovecot_impersonate/) und fügen Sie Roundcube als App hinzu (siehe oben).
@ -392,6 +223,7 @@ services:
- ALLOW_ADMIN_EMAIL_LOGIN_ROUNDCUBE=${ALLOW_ADMIN_EMAIL_LOGIN_ROUNDCUBE:-n}
```
Bearbeiten Sie `data/web/js/site/mailbox.js` und den folgenden Code nach [`if (ALLOW_ADMIN_EMAIL_LOGIN) { ... }`](https://github.com/mailcow/mailcow-dockerized/blob/2f9da5ae93d93bf62a8c2b7a5a6ae50a41170c48/data/web/js/site/mailbox.js#L485-L487)
```js
@ -406,7 +238,7 @@ Bearbeiten Sie `data/web/mailbox.php` und fügen Sie diese Zeile zum Array [`$te
'allow_admin_email_login_roundcube' => (preg_match("/^(yes|y)+$/i", $_ENV["ALLOW_ADMIN_EMAIL_LOGIN_ROUNDCUBE"])) ? 'true' : 'false',
```
Bearbeiten Sie `data/web/templates/mailbox.twig` und fügen Sie diesen Code am Ende des [Javascript-Abschnitts](https://github.com/mailcow/mailcow-dockerized/blob/2f9da5ae93d93bf62a8c2b7a5a6ae50a41170c48/data/web/templates/mailbox.twig#L49-L57) ein:
Bearbeiten Sie `data/web/templates/mailbox.twig` und fügen Sie diesen Code am Ende des [javascript-Abschnitts](https://github.com/mailcow/mailcow-dockerized/blob/2f9da5ae93d93bf62a8c2b7a5a6ae50a41170c48/data/web/templates/mailbox.twig#L49-L57) ein:
```js
var ALLOW_ADMIN_EMAIL_LOGIN_ROUNDCUBE = {{ allow_admin_email_login_roundcube }};
@ -417,7 +249,6 @@ Kopieren Sie den Inhalt der folgenden Dateien aus diesem [Snippet](https://gitla
* `data/web/inc/lib/RoundcubeAutoLogin.php`
* `data/web/rc-auth.php`
## Abschluss der Installation
Starten Sie schließlich mailcow neu
=== "docker compose (Plugin)"
@ -430,233 +261,10 @@ Starten Sie schließlich mailcow neu
=== "docker-compose (Standalone)"
``` bash
docker-compose down
docker-compose down
docker-compose up -d
```
## Aktualisierung von Roundcube
Ein Upgrade von Roundcube ist recht einfach: Gehen Sie auf die
[GitHub releases](https://github.com/roundcube/roundcubemail/releases) Seite für Roundcube und holen Sie sich den Link
für die "complete.tar.gz" Datei für die gewünschte Version. Dann folgen Sie den untenstehenden Befehlen und ändern Sie
die URL und den Namen des Roundcube-Ordners, falls nötig.
```bash
# Starten Sie eine Bash-Sitzung des mailcow PHP-Containers
docker exec -it mailcowdockerized-php-fpm-mailcow-1 bash
# Installieren Sie die erforderliche Upgrade-Abhängigkeit, dann aktualisieren Sie Roundcube auf die gewünschte Version
apk add rsync
cd /tmp
wget -O - https://github.com/roundcube/roundcubemail/releases/download/1.6.1/roundcubemail-1.6.1-complete.tar.gz | tar xfvz -
cd roundcubemail-1.6.1
bin/installto.sh /web/rc
# Geben Sie 'Y' ein und drücken Sie die Eingabetaste, um Ihre Installation von Roundcube zu aktualisieren.
# Geben Sie 'N' ein, wenn folgender Dialog erscheint: "Do you want me to fix your local configuration".
# Sollte im Output eine Notice kommen "NOTICE: Update dependencies by running php composer.phar update --no-dev" führen
Sie composer aus:
cd /web/rc
composer update --no-dev -o
# Auf die Frage "Do you trust "roundcube/plugin-installer" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] " bitte mit y antworten.
# Entfernen Sie übrig gebliebene Dateien
rm -rf /tmp/roundcube*
# Falls Sie von Version 1.5 auf 1.6 updaten, dann führen Sie folgende Befehle aus, um die Konfigurationsdatei anzupassen:`
sed -i "s/\$config\['default_host'\].*$/\$config\['imap_host'\]\ =\ 'dovecot:143'\;/" /web/rc/config/config.inc.php
sed -i "/\$config\['default_port'\].*$/d" /web/rc/config/config.inc.php
sed -i "s/\$config\['smtp_server'\].*$/\$config\['smtp_host'\]\ =\ 'postfix:588'\;/" /web/rc/config/config.inc.php
sed -i "/\$config\['smtp_port'\].*$/d" /web/rc/config/config.inc.php
sed -i "s/\$config\['managesieve_host'\].*$/\$config\['managesieve_host'\]\ =\ 'dovecot:4190'\;/" /web/rc/config/config.inc.php
sed -i "/\$config\['managesieve_port'\].*$/d" /web/rc/config/config.inc.php
```
### Aktualisierung von composer-Plugins
Um Roundcube-Plugins und -Abhängigkeiten zu aktualisieren, die mit composer installiert wurden (z. B.
RCMCardDAV-Plugin), führen Sie einfach composer im Container aus:
```bash
docker exec -it -w /web/rc $(docker ps -f name=php-fpm-mailcow -q) composer update --no-dev -o
```
### Aktualisierung des MIME-Typ-Verzeichnisses
Um das MIME-Typ-Verzeichnis zu aktualisieren, laden Sie dieses erneut mit dem Kommando aus den
[Installations-Anweisungen](#Installation-des-MIME-Typ-Verzeichnisses) herunter.
## Deinstallation von Roundcube
Für die Deinstallation wird ebenfalls angenommen, dass die Kommandos im mailcow-Installationsverzeichnis ausgeführt
werden und dass `mailcow.conf` in die Shell geladen wurde, siehe Abschnitt [Vorbereitung](#Vorbereitung) oben.
### Entfernen des Web-Verzeichnisses
Dies entfernt die Roundcube-Installation mit allen Plugins und Abhängigkeiten die Sie ggf. installiert haben,
einschließlich solcher, die mit composer installiert wurden.
Hinweis: Dies entfernt auch alle angepassten Konfigurationen die Sie ggf. in Roundcube durchgeführt haben. Sollten Sie
diese erhalten wollen, verschieben Sie das Verzeichnis an einen anderen Ort statt es zu entfernen.
```bash
rm -r data/web/rc
```
### Entfernen der Datenbank
Hinweis: Dies löscht alle Daten, die Roundcube abgespeichert hat. Wenn Sie diese erhalten möchten, können Sie
`mysqldump` ausführen, bevor Sie die Datenbank löschen, oder die Datenbank einfach nicht löschen.
```bash
docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -e "DROP USER 'roundcube'@'%';"
docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -e "DROP DATABASE roundcubemail;"
```
### Entfernen der Konfigurationsanpassungen für mailcow
Um die Dateien zu ermitteln, lesen Sie bitte die Installationsanweisungen und machen Sie die Schritte, die Sie dort
zuvor durchgeführt haben, rückgängig.
## Migration von einer älteren mailcow-Roundcube-Installation
Ältere Versionen dieser Anleitung verwendeten die mailcow-Datenbank auch für Roundcube, mit einem konfigurierten Präfix
`mailcow_rc1` für alle Roundcube-Tabellen.
Zur Migration wird ebenfalls angenommen, dass alle Kommandos im mailcow-Installationsverzeichnis ausgeführt werden und
`mailcow.conf` in die Shell geladen wurde, siehe [Vorbereitung](#Vorbereitung) oben. Dies Kommandos der verschiedenen
Schritte bauen aufeinander auf und müssen innerhalb derselben Shell ausgeführt werden. Insbesondere setzen einige
Schritte Shell-Variablen (besonders die `DBROUNDCUBE`-Variable mit dem Datenbank-Passwort für den
roundcube-Datenbankbenutzer), die in späteren Schritten verwendet werden.
### Anlegen eines neuen roundcube-Datenbankbenutzers und der Datenbank
Folgen Sie den [Anweisungen oben](#Anlegen-der-Roundcube-Datenbank) um den roundcube-Datenbankbenutzer und die getrennte
Datenbank anzulegen.
### Migration der Roundcube-Daten aus der mailcow-Datenbank
Bevor wir mit der Migration starten, deaktivieren wir Roundcube, um weitere Änderungen an dessen Datenbank-Tabellen zu
vermeiden.
```bash
cat <<EOCONFIG >data/conf/nginx/site.roundcube.custom
location ^~ /rc/ {
return 503;
}
EOCONFIG
docker compose exec nginx-mailcow nginx -s reload
```
Nun kopieren wir die Roundcube-Daten in die neue Datenbank. Wir entfernen das Datenbank-Tabellen-Präfix in diesem
Schritt, welches Sie ggf. anpassen müssen, wenn Sie ein anderes Präfix als `mailcow_rc1` verwendet haben. Es ist auch
möglich, das Präfix beizubehalten (in diesem Fall behalten Sie auch die zugehörige Roundcube-Einstellung `db_prefix`
bei).
```bash
RCTABLES=$(docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -sN mailcow -e "show tables like 'mailcow_rc1%';" | tr '\n\r' ' ')
docker exec $(docker ps -f name=mysql-mailcow -q) /bin/bash -c "mysqldump -uroot -p${DBROOT} mailcow $RCTABLES | sed 's/mailcow_rc1//' | mysql -uroot -p${DBROOT} roundcubemail"
```
### Aktualisierung der Roundcube-Konfiguration
Führen Sie folgende Kommandos aus, um die nicht mehr notwendige `db_prefix` Option zu entfernen. Wir aktivieren außerdem
das Logging in Roundcube, indem wir die Einstellungen `log_dir` und `temp_dir` entfernen, welche Teil der alten
Anweisungen waren.
```bash
sed -i "/\$config\['db_prefix'\].*$/d" data/web/rc/config/config.inc.php
sed -i "/\$config\['log_dir'\].*$/d" data/web/rc/config/config.inc.php
sed -i "/\$config\['temp_dir'\].*$/d" data/web/rc/config/config.inc.php
```
Wir müssen die nginx-Konfiguration anpassen, so dass nicht-öffentliche Verzeichnisse von Roundcube nicht exponiert
werden, insbesondere die Verzeichnisse, welche Log-Dateien und temporäre Dateien enthalten:
```bash
cat <<EOCONFIG >data/conf/nginx/site.roundcube.custom
location /rc/ {
alias /web/rc/public_html/;
}
EOCONFIG
```
Wir können auch die `cipher_method`-Einstellung auf eine sicherere Einstellung ändern, aber beachten Sie, dass mit der
alten Methode verschlüsselte Daten danach nicht mehr entschlüsselt werden können. Dies betrifft insbesondere
CardDAV-Passwörter, sofern Sie RCMCardDAV verwenden und Ihre Nutzer benutzerdefinierte Adressbücher hinzugefügt haben
(die Admin-Voreinstellungen für die SOGo-Adressbücher werden automatisch beim nächsten Login für den jeweiligen Nutzer
korrigiert). Wenn Sie die `cipher_method` ändern wollen, führen Sie folgendes Kommando aus:
```bash
cat <<EOCONFIG >>data/web/rc/config/config.inc.php
\$config['cipher_method'] = 'chacha20-poly1305';
EOCONFIG
```
### Umstellung des RCMCardDAV-Plugins auf die Installation mittels composer
Dieser Schritt ist optional, aber er gleicht Ihre Installation an die aktuelle Fassung der Anweisungen an und ermöglicht
die Aktualisierung von RCMCardDAV mittels composer. Dies wird einfach dadurch erreicht, dass das carddav-Plugin aus dem
Installationsverzeichnis gelöscht und entsprechend der [Anweisungen oben](#CardDAV-Adressbücher-in-Roundcube-einbinden)
installiert wird, einschließlich der Erstellung einer neuen RCMCardDAV v5-Konfiguration. Falls Sie das RCMCardDAV
angepasst haben, sollten Sie dieses sichern, bevor Sie das Plugin löschen, und Ihre Anpassungen später in die neue
Konfigurationsdatei übernehmen.
Um das carddav-Plugin zu löschen, führen Sie folgendes Kommando aus, danach befolgen Sie zur Neuinstallation die
[Anweisungen oben](#CardDAV-Adressbücher-in-Roundcube-einbinden):
```bash
rm -r data/web/rc/plugins/carddav
```
### Umschalten von Roundcube auf die neue Datenbank
Zunächst passen wir die Roundcube-Konfiguration an, so dass die neue Datenbank verwendet wird.
```bash
sed -i "/\$config\['db_dsnw'\].*$/d" data/web/rc/config/config.inc.php
cat <<EOCONFIG >>data/web/rc/config/config.inc.php
\$config['db_dsnw'] = 'mysql://roundcube:${DBROUNDCUBE}@mysql/roundcubemail';
EOCONFIG
```
### Roundcube Web-Zugriff reaktivieren
Führen Sie chown und chmod auf den sensitiven Roundcube-Verzeichnissen, welche in [Vorbereitung](#Vorbereitung)
aufgeführt sind aus, um sicherzustellen, dass der nginx-Webserver nicht auf Dateien zugreifen darf, die er nicht
ausliefern soll.
Dann reaktivieren Sie den Web-Zugriff für Roundcube, indem Sie die temporäre Roundcube-Konfigurations-Erweiterung für
nginx durch die [oben](#Webserver-Konfiguration) beschriebene ersetzen, und laden anschließend die nginx-Konfiguration
neu:
```bash
docker compose exec nginx-mailcow nginx -s reload
```
### Andere Anpassungen
Sie müssen auch die Konfiguration des Roundcube password-Plugins entsprechend dieser Anweisungen anpassen, sofern Sie
diese Funktionalität aktiviert haben, da die alten Anweisungen das Passwort direkt in der mailcow-Datenbank änderten,
wohingegen diese Fassung der Anweisungen die mailcow-API zur Passwort-Änderung verwendet.
Bezüglich weiterer Anpassungen und Neuerungen (z. B. roundcube-dovecot\_client\_ip Plugin) können Sie die aktuellen
Anweisungen durchgehen und Ihre Konfiguration entsprechend anpassen bzw. die genannten Installationsschritte für neue
Funktionalitäten ausführen.
Insbesondere beachten Sie folgende Abschnitte:
- [Ofelia-Job für Roundcube-Aufräumtätigkeiten](#Ofelia-Job-für-Roundcube-Aufräumtätigkeiten)
- [Ermöglichen der Klartext-Authentifizierung für den php-fpm-Container ohne die Verwendung von TLS](#Ermöglichen-der-Klartext-Authentifizierung-für-den-php-fpm-Container-ohne-die-Verwendung-von-TLS)
- [Übermittlung der Client-Netzwerkadresse an Dovecot](#Übermittlung-der-Client-Netzwerkadresse-an-Dovecot)
### Entfernen der Roundcube-Tabellen aus der mailcow-Datenbank
Nachdem Sie sichergestellt haben, dass die Migration erfolgreich durchgeführt wurde und Roundcube mit der getrennten
Datenbank funktioniert, können Sie die Roundcube-Tabellen aus der mailcow-Datenbank mit dem folgenden Kommando
entfernen:
```bash
docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -sN mailcow -e "SET SESSION foreign_key_checks = 0; DROP TABLE IF EXISTS $(echo $RCTABLES | sed -e 's/ \+/,/g');"
```

Datei anzeigen

@ -1,352 +1,207 @@
## Installing Roundcube
Unless otherwise stated, all of the given commands are expected to be executed in the mailcow installation directory,
i.e., the directory containing `mailcow.conf` etc. Please do not blindly execute the commands but understand what they
do. None of the commands is supposed to produce an error, so if you encounter an error, fix it if necessary before
continuing with the subsequent commands.
### Note on composer usage
This guide uses composer to update roundcube dependencies or install / update roundcube plugins.
The roundcube-plugin-installer composer plugin has a [design issue](https://github.com/roundcube/plugin-installer/issues/38)
that can lead to composer errors when packages are upgraded or uninstalled in the composer execution.
The error message will typically tell you that a `require` in `autoload_real.php` failed because a file could not be
opened. Example:
```
In autoload_real.php line 43:
require(/web/rc/vendor/composer/../guzzlehttp/promises/src/functions_include.php): Failed to open stream: No such file or directory
```
Unfortunately these occur quite frequently, but they can be worked around by updating the autoloader and re-running the
failed command:
Download Roundcube 1.6.x to the web htdocs directory and extract it (here `rc/`):
```bash
docker exec -it -w /web/rc $(docker ps -f name=php-fpm-mailcow -q) composer dump-autoload -o
# Now execute the command that failed again
# Check for a newer release!
cd data/web
wget -O - https://github.com/roundcube/roundcubemail/releases/download/1.6.1/roundcubemail-1.6.1-complete.tar.gz | tar xfvz -
# Change folder name
mv roundcubemail-1.6.1 rc
# Change permissions
chown -R root: rc/
```
### Preparation
First we load `mailcow.conf` so we have access to the mailcow configuration settings for the following commands.
```bash
source mailcow.conf
```
Download Roundcube 1.6.x (check for latest release and adapt URL) to the web directory and extract it (here `rc/`):
```bash
mkdir -m 755 data/web/rc
wget -O - https://github.com/roundcube/roundcubemail/releases/download/1.6.1/roundcubemail-1.6.1-complete.tar.gz | tar -xvz --no-same-owner -C data/web/rc --strip-components=1 -f -
docker exec -it $(docker ps -f name=php-fpm-mailcow -q) chown www-data:www-data /web/rc/logs /web/rc/temp
docker exec -it $(docker ps -f name=php-fpm-mailcow -q) chown root:www-data /web/rc/config
docker exec -it $(docker ps -f name=php-fpm-mailcow -q) chmod 750 /web/rc/logs /web/rc/temp /web/rc/config
```
### Optional: Spellchecking
If you need spell check features, create a file `data/hooks/phpfpm/aspell.sh` with the following content, then
`chmod +x data/hooks/phpfpm/aspell.sh`. This installs a local spell check engine. Note, most modern web browsers have
built in spell check, so you may not want/need this.
If you need spell check features, create a file `data/hooks/phpfpm/aspell.sh` with the following content, then `chmod +x data/hooks/phpfpm/aspell.sh`. This installs a local spell check engine. Note, most modern web browsers have built in spell check, so you may not want/need this.
```bash
#!/bin/bash
apk update
apk add aspell-en # or any other language
```
### Install mime type mappings
Download the `mime.types` file as it is not included in the php-fpm container.
```bash
wget -O data/web/rc/config/mime.types http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
```
### Create roundcube database
Create a database for roundcube in the mailcow MySQL container. This creates a new `roundcube` database user
with a random password, which will be echoed to the shell and stored in a shell variable for use by later
commands. Note that when you interrupt the process and continue in a new shell, you must set the `DBROUNDCUBE`
shell variable manually to the password output by the following commands.
```bash
DBROUNDCUBE=$(LC_ALL=C </dev/urandom tr -dc A-Za-z0-9 2> /dev/null | head -c 28)
echo Database password for user roundcube is $DBROUNDCUBE
docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -e "CREATE DATABASE roundcubemail CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -e "CREATE USER 'roundcube'@'%' IDENTIFIED BY '${DBROUNDCUBE}';"
docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -e "GRANT ALL PRIVILEGES ON roundcubemail.* TO 'roundcube'@'%';"
```
### Roundcube configuration
Create a file `data/web/rc/config/config.inc.php` with the following content.
- The `des_key` option is set to a random value. It is used to temporarily store your IMAP password.
- The plugins list can be adapted to your preference. I added a set of standard plugins that I consider of common
usefulness and which work well together with mailcow:
- The archive plugin adds an archive button that moves selected messages to a user-configurable archive folder.
- The managesieve plugin provides a user-friendly interface to manage server-side mail filtering and vacation / out
of office notification.
- The acl plugin allows to manage access control lists on IMAP folders, including the ability to share IMAP folders
to other users.
- The markasjunk plugin adds buttons to mark selected messages as junk (or messages in the junk folder not as junk)
and moves them to the junk folder or back to the inbox. The sieve filters included with mailcow will take care
that action triggers a learn as spam/ham action in rspamd, so no further configuration of the plugin is needed.
- The zipdownload plugin allows to download multiple message attachments or messages as a zip file.
- If you didn't install spell check in the above step, remove `spellcheck_engine` parameter.
```bash
cat <<EOCONFIG >data/web/rc/config/config.inc.php
<?php
\$config['db_dsnw'] = 'mysql://roundcube:${DBROUNDCUBE}@mysql/roundcubemail';
\$config['imap_host'] = 'dovecot:143';
\$config['smtp_host'] = 'postfix:588';
\$config['smtp_user'] = '%u';
\$config['smtp_pass'] = '%p';
\$config['support_url'] = '';
\$config['product_name'] = 'Roundcube Webmail';
\$config['cipher_method'] = 'chacha20-poly1305';
\$config['des_key'] = '$(LC_ALL=C </dev/urandom tr -dc "A-Za-z0-9 !#$%&()*+,-./:;<=>?@[\\]^_{|}~" 2> /dev/null | head -c 32)';
\$config['plugins'] = [
'archive',
'managesieve',
'acl',
'markasjunk',
'zipdownload',
];
\$config['spellcheck_engine'] = 'aspell';
\$config['mime_types'] = '/web/rc/config/mime.types';
\$config['enable_installer'] = true;
\$config['managesieve_host'] = 'dovecot:4190';
// Enables separate management interface for vacation responses (out-of-office)
// 0 - no separate section (default); 1 - add Vacation section; 2 - add Vacation section, but hide Filters section
\$config['managesieve_vacation'] = 1;
EOCONFIG
docker exec -it $(docker ps -f name=php-fpm-mailcow -q) chown root:www-data /web/rc/config/config.inc.php
docker exec -it $(docker ps -f name=php-fpm-mailcow -q) chmod 640 /web/rc/config/config.inc.php
```
### Initialize database
Point your browser to `https://myserver/rc/installer`. Check that the website shows no "NOT OK" check results on
any of the steps, some "NOT AVAILABLE" are expected regarding different database extensions of which we only need MySQL.
Initialize the database and leave the installer. It is not necessary to update the configuration with
the downloaded one, unless you made some settings in the installer you would like to take over.
### Webserver configuration
The roundcube directory includes some locations that we do not want to serve to web users. We add a configuration
extension to nginx to only expose the public directory of roundcube.
```bash
cat <<EOCONFIG >data/conf/nginx/site.roundcube.custom
location /rc/ {
alias /web/rc/public_html/;
}
EOCONFIG
```
### Disable and remove installer
Delete the directory `data/web/rc/installer` after a successful installation, and set the `enable_installer` option
to false in `data/web/rc/config/config.inc.php`:
```bash
rm -r data/web/rc/installer
sed -i -e "s/\(\$config\['enable_installer'\].* = \)true/\1false/" data/web/rc/config/config.inc.php
```
### Update roundcube dependencies
This step is not strictly necessary, but at least at the time of this writing the dependencies shipped with roundcube
included versions with security vulnerabilities, so it may be a good idea to update the dependencies to the latest
versions. For the same reason, it may be a good idea to run the composer update once in a while.
```bash
cp -n data/web/rc/composer.json-dist data/web/rc/composer.json
docker exec -it -w /web/rc $(docker ps -f name=php-fpm-mailcow -q) composer update --no-dev -o
```
You can also use `composer audit` to check for any reported security issues with the installed set of composer packages:
```bash
docker exec -it -w /web/rc $(docker ps -f name=php-fpm-mailcow -q) composer audit
```
### Allow plaintext authentication for the php-fpm container without using TLS
We need to allow plaintext authentication in dovecot over unencrypted connection (inside the container network), which
is per default mailcow installation only possible for the SOGo container for the very same purpose. Afterwards restart
the dovecot container so the change becomes effective.
```bash
cat <<EOCONFIG >>data/conf/dovecot/extra.conf
remote ${IPV4_NETWORK}.0/24 {
disable_plaintext_auth = no
}
remote ${IPV6_NETWORK} {
disable_plaintext_auth = no
}
EOCONFIG
docker compose restart dovecot-mailcow
```
### Ofelia job for roundcube housekeeping
Roundcube needs to clean some stale information from the database every once in a while,
for which we will create an ofelia job that runs the roundcube `cleandb.sh` script.
To do this, add the following to `docker-compose.override.yml` (if you already have some
adaptations for the php-fpm container, add the labels to the existing section):
```yml
version: '2.1'
services:
php-fpm-mailcow:
labels:
ofelia.enabled: "true"
ofelia.job-exec.roundcube_cleandb.schedule: "@every 168h"
ofelia.job-exec.roundcube_cleandb.user: "www-data"
ofelia.job-exec.roundcube_cleandb.command: "/bin/bash -c \"[ -f /web/rc/bin/cleandb.sh ] && /web/rc/bin/cleandb.sh\""
```
## Optional extra functionality
### Enable change password function in Roundcube
Changing the mailcow password from the roundcube UI is supported via the password plugin. We will configure it to use
the mailcow API to update the password, which requires to enable the API first and to get the API key (read/write API
access required). The API can be enabled in the mailcow admin interface, where you can also find the API key.
Open `data/web/rc/config/config.inc.php` and enable the password plugin by adding it to the `$config['plugins']` array,
for example:
- **Change the `des_key` parameter to a random value.** It is used to temporarily store your IMAP password.
- The `db_prefix` is optional but recommended.
- If you didn't install spell check in the above step, remove `spellcheck_engine` parameter and replace it with `$config['enable_spellcheck'] = false;`.
```php
<?php
error_reporting(0);
if (!file_exists('/tmp/mime.types')) {
file_put_contents("/tmp/mime.types", fopen("http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types", 'r'));
}
$config = array();
$config['db_dsnw'] = 'mysql://' . getenv('DBUSER') . ':' . getenv('DBPASS') . '@mysql/' . getenv('DBNAME');
$config['imap_host'] = 'tls://dovecot:143';
$config['smtp_host'] = 'tls://postfix:587';
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['support_url'] = '';
$config['product_name'] = 'Roundcube Webmail';
$config['des_key'] = 'yourrandomstring_changeme';
$config['log_dir'] = '/dev/null';
$config['temp_dir'] = '/tmp';
$config['plugins'] = array(
'archive',
'managesieve',
'acl',
'markasjunk',
'zipdownload',
'password',
'managesieve'
);
$config['spellcheck_engine'] = 'aspell';
$config['mime_types'] = '/tmp/mime.types';
$config['imap_conn_options'] = array(
'ssl' => array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true)
);
$config['enable_installer'] = true;
$config['smtp_conn_options'] = array(
'ssl' => array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true)
);
$config['db_prefix'] = 'mailcow_rc1';
```
Configure the password plugin (be sure to adapt __\*\*API_KEY\*\*__ to you mailcow read/write API key):
Point your browser to `https://myserver/rc/installer` and follow the instructions.
Initialize the database and leave the installer.
```bash
cat <<EOCONFIG >data/web/rc/plugins/password/config.inc.php
<?php
\$config['password_driver'] = 'mailcow';
\$config['password_confirm_current'] = true;
\$config['password_mailcow_api_host'] = 'http://nginx';
\$config['password_mailcow_api_token'] = '**API_KEY**';
EOCONFIG
**Delete the directory `data/web/rc/installer` after a successful installation!**
## Configure ManageSieve filtering
Open `data/web/rc/config/config.inc.php` and change the following parameters (or add them at the bottom of that file):
```php
$config['managesieve_host'] = 'tls://dovecot:4190';
$config['managesieve_conn_options'] = array(
'ssl' => array('verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true)
);
// Enables separate management interface for vacation responses (out-of-office)
// 0 - no separate section (default),
// 1 - add Vacation section,
// 2 - add Vacation section, but hide Filters section
$config['managesieve_vacation'] = 1;
```
Note: If you have changed the mailcow nginx configuration to redirect http requests to https
(e.g., as described [here](https://docs.mailcow.email/manual-guides/u_e-80_to_443/)), then
directly talking to the nginx container via http will not work because nginx is not a hostname contained
in the certificate. In such cases, set `password_mailcow_api_host` in the above configuration to the
public URI instead:
## Enable change password function in Roundcube
```bash
cat <<EOCONFIG >data/web/rc/plugins/password/config.inc.php
<?php
\$config['password_driver'] = 'mailcow';
\$config['password_confirm_current'] = true;
\$config['password_mailcow_api_host'] = 'https://${MAILCOW_HOSTNAME}';
\$config['password_mailcow_api_token'] = '**API_KEY**';
EOCONFIG
```
### Integrate CardDAV addressbooks in Roundcube
Install the latest v5 version (the config below is compatible with v5 releases) using composer.
Answer `Y` when asked if you want to activate the plugin.
```bash
docker exec -it -w /web/rc $(docker ps -f name=php-fpm-mailcow -q) composer require --update-no-dev -o "roundcube/carddav:~5"
```
Edit the file `data/web/rc/plugins/carddav/config.inc.php` and insert the following content:
```bash
cat <<EOCONFIG >data/web/rc/plugins/carddav/config.inc.php
<?php
\$prefs['_GLOBAL']['pwstore_scheme'] = 'des_key';
\$prefs['SOGo'] = [
'accountname' => 'SOGo',
'username' => '%u',
'password' => '%p',
'discovery_url' => 'http://sogo:20000/SOGo/dav/',
'name' => '%N',
'use_categories' => true,
'fixed' => ['username', 'password'],
];
EOCONFIG
```
RCMCardDAV will add all addressbooks of the user on login, including __subscribed__ addressbooks shared to the user by
other users.
If you want to remove the default addressbooks (stored in the Roundcube database), so that only the CardDAV addressbooks
are accessible, append `$config['address_book_type'] = '';` to the config file `data/web/rc/config/config.inc.php`.
Note: RCMCardDAV uses additional database tables. After installing (or upgrading) RCMCardDAV, it is required to log
in roundcube (log out first if already logged in) because the database table creation / changes are performed only
during the login to roundcube.
### Forward the client network address to dovecot
Normally, the IMAP server dovecot will see the network address of the php-fpm container when roundcube interacts with the IMAP
server. Using an IMAP extension and the `roundcube-dovecot_client_ip` roundcube plugin, it is possible for roundcube to tell
dovecot the client IP, so it will also show up in the logs as the remote IP. When doing this, login attempts will show in the
dovecot logs like any direct client connections to dovecot, and such failed logins into roundcube will be treated in the same
manner as failed direct IMAP logins, causing blocking of the client with the netfilter container or other mechanisms that may
already be in place to handle bruteforce attacks on the IMAP server.
For this, the roundcube plugin must be installed.
```bash
docker exec -it -w /web/rc $(docker ps -f name=php-fpm-mailcow -q) composer require --update-no-dev -o "takerukoushirou/roundcube-dovecot_client_ip:~1"
```
Furthermore, we must configure dovecot to treat the php-fpm container as part of a trusted network so it is allowed to override
the client IP in the IMAP session. Note that this also enables plaintext authentication for the listed network ranges, so the
explicit overridings of `disable_plaintext_auth` done above are not necessary when using this.
```bash
cat <<EOCONFIG >>data/conf/dovecot/extra.conf
login_trusted_networks = ${IPV4_NETWORK}.0/24 ${IPV6_NETWORK}
EOCONFIG
docker compose restart dovecot-mailcow
```
### Add roundcube link to mailcow Apps list
You can add Roundcube's link to the mailcow Apps list.
To do this, open or create `data/web/inc/vars.local.inc.php` and make sure it includes the following configuration
block:
Open `data/web/rc/config/config.inc.php` and enable the password plugin:
```php
<?php
$MAILCOW_APPS = [
[
'name' => 'SOGo',
'link' => '/SOGo/'
],
[
'name' => 'Roundcube',
'link' => '/rc/'
]
];
...
$config['plugins'] = array(
'archive',
'password',
);
...
```
### Let admins log into Roundcube without password
Open `data/web/rc/plugins/password/password.php`, search for `case 'ssha':` and add above:
```php
case 'ssha256':
$salt = rcube_utils::random_bytes(8);
$crypted = base64_encode( hash('sha256', $password . $salt, TRUE ) . $salt );
$prefix = '{SSHA256}';
break;
```
Open `data/web/rc/plugins/password/config.inc.php` and change the following parameters (or add them at the bottom of that file):
```php
$config['password_driver'] = 'sql';
$config['password_algorithm'] = 'ssha256';
$config['password_algorithm_prefix'] = '{SSHA256}';
$config['password_query'] = "UPDATE mailbox SET password = %P WHERE username = %u";
```
## Integrate CardDAV addressbooks in Roundcube
Download the latest release of [RCMCardDAV](https://github.com/mstilkerich/rcmcarddav) to the Roundcube plugin directory and extract it (here `rc/plugins`):
```bash
cd data/web/rc/plugins
wget -O - https://github.com/mstilkerich/rcmcarddav/releases/download/v4.4.1/carddav-v4.4.1-roundcube16.tar.gz | tar xfvz -
chown -R root: carddav/
```
Copy the file `config.inc.php.dist` to `config.inc.php` (here in `rc/plugins/carddav`) and append the following preset to the end of the file - don't forget to replace `mx.example.org` with your own hostname:
```php
$prefs['SOGo'] = array(
'name' => 'SOGo',
'username' => '%u',
'password' => '%p',
'url' => 'https://mx.example.org/SOGo/dav/%u/',
'carddav_name_only' => true,
'use_categories' => true,
'active' => true,
'readonly' => false,
'refresh_time' => '02:00:00',
'fixed' => array( 'active', 'name', 'username', 'password', 'refresh_time' ),
'hide' => false,
);
```
Please note, that this preset only integrates the default addressbook (the one that's named "Personal Address Book" and can't be deleted). Additional addressbooks are currently not automatically detected but can be manually added within the roundecube settings.
Enable the plugin by adding `carddav` to `$config['plugins']` in `rc/config/config.inc.php`.
If you want to remove the default addressbooks (stored in the Roundcube database), so that only the CardDAV addressbooks are accessible, append `$config['address_book_type'] = '';` to the config file `data/web/rc/config/config.inc.php`.
---
Optionally, you can add Roundcube's link to the mailcow Apps list.
To do this, open or create `data/web/inc/vars.local.inc.php` and add the following code-block:
*NOTE: Don't forget to add the `<?php` delimiter on the first line*
```php
...
$MAILCOW_APPS = array(
array(
'name' => 'SOGo',
'link' => '/SOGo/'
),
array(
'name' => 'Roundcube',
'link' => '/rc/'
)
);
...
```
## Upgrading Roundcube
Upgrading Roundcube is rather simple, go to the [Github releases](https://github.com/roundcube/roundcubemail/releases) page for Roundcube and get the link for the "complete.tar.gz" file for the wanted release. Then follow the below commands and change the URL and Roundcube folder name if needed.
```bash
# Enter a bash session of the mailcow PHP container
docker exec -it mailcowdockerized-php-fpm-mailcow-1 bash
# Install required upgrade dependency, then upgrade Roundcube to wanted release
apk add rsync
cd /tmp
wget -O - https://github.com/roundcube/roundcubemail/releases/download/1.6.1/roundcubemail-1.6.1-complete.tar.gz | tar xfvz -
cd roundcubemail-1.6.1
bin/installto.sh /web/rc
# Type 'Y' and press enter to upgrade your install of Roundcube
# Type 'N' to "Do you want me to fix your local configuration" if prompted
# If you see "NOTICE: Update dependencies by running php composer.phar update --no-dev" just download composer.phar and run it:
cd /web/rc
wget https://getcomposer.org/download/2.4.2/composer.phar
php composer.phar update --no-dev
# When asked "Do you trust "roundcube/plugin-installer" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] " hit y and continue.
# Remove leftover files
cd /tmp
rm -rf roundcube*
# If you're going from 1.5 to 1.6 please run the config file changes below
sed -i "s/\$config\['default_host'\].*$/\$config\['imap_host'\]\ =\ 'tls:\/\/dovecot:143'\;/" /web/rc/config/config.inc.php
sed -i "/\$config\['default_port'\].*$/d" /web/rc/config/config.inc.php
sed -i "s/\$config\['smtp_server'\].*$/\$config\['smtp_host'\]\ =\ 'tls:\/\/postfix:587'\;/" /web/rc/config/config.inc.php
sed -i "/\$config\['smtp_port'\].*$/d" /web/rc/config/config.inc.php
sed -i "s/\$config\['managesieve_host'\].*$/\$config\['managesieve_host'\]\ =\ 'tls:\/\/dovecot:4190'\;/" /web/rc/config/config.inc.php
sed -i "/\$config\['managesieve_port'\].*$/d" /web/rc/config/config.inc.php
```
## Let admins log into Roundcube without password
First, install plugin [dovecot_impersonate](https://github.com/corbosman/dovecot_impersonate/) and add Roundcube as an app (see above).
@ -369,6 +224,7 @@ services:
- ALLOW_ADMIN_EMAIL_LOGIN_ROUNDCUBE=${ALLOW_ADMIN_EMAIL_LOGIN_ROUNDCUBE:-n}
```
Edit `data/web/js/site/mailbox.js` and the following code after [`if (ALLOW_ADMIN_EMAIL_LOGIN) { ... }`](https://github.com/mailcow/mailcow-dockerized/blob/2f9da5ae93d93bf62a8c2b7a5a6ae50a41170c48/data/web/js/site/mailbox.js#L485-L487)
```js
@ -394,7 +250,6 @@ Copy the contents of the following files from this [Snippet](https://gitlab.com/
* `data/web/inc/lib/RoundcubeAutoLogin.php`
* `data/web/rc-auth.php`
## Finish installation
Finally, restart mailcow
=== "docker compose (Plugin)"
@ -407,218 +262,6 @@ Finally, restart mailcow
=== "docker-compose (Standalone)"
``` bash
docker-compose down
docker-compose down
docker-compose up -d
```
## Upgrading Roundcube
Upgrading Roundcube is rather simple, go to the [GitHub releases](https://github.com/roundcube/roundcubemail/releases)
page for Roundcube and get the link for the "complete.tar.gz" file for the wanted release. Then follow the below
commands and change the URL and Roundcube folder name if needed.
```bash
# Enter a bash session of the mailcow PHP container
docker exec -it mailcowdockerized-php-fpm-mailcow-1 bash
# Install required upgrade dependency, then upgrade Roundcube to wanted release
apk add rsync
cd /tmp
wget -O - https://github.com/roundcube/roundcubemail/releases/download/1.6.1/roundcubemail-1.6.1-complete.tar.gz | tar xfvz -
cd roundcubemail-1.6.1
bin/installto.sh /web/rc
# Type 'Y' and press enter to upgrade your install of Roundcube
# Type 'N' to "Do you want me to fix your local configuration" if prompted
# If you see "NOTICE: Update dependencies by running php composer.phar update --no-dev" run composer:
cd /web/rc
composer update --no-dev -o
# If asked "Do you trust "roundcube/plugin-installer" to execute code and wish to enable it now? (writes "allow-plugins" to composer.json) [y,n,d,?] " hit y and continue.
# Remove leftover files
rm -rf /tmp/roundcube*
# If you're going from 1.5 to 1.6 please run the config file changes below
sed -i "s/\$config\['default_host'\].*$/\$config\['imap_host'\]\ =\ 'dovecot:143'\;/" /web/rc/config/config.inc.php
sed -i "/\$config\['default_port'\].*$/d" /web/rc/config/config.inc.php
sed -i "s/\$config\['smtp_server'\].*$/\$config\['smtp_host'\]\ =\ 'postfix:588'\;/" /web/rc/config/config.inc.php
sed -i "/\$config\['smtp_port'\].*$/d" /web/rc/config/config.inc.php
sed -i "s/\$config\['managesieve_host'\].*$/\$config\['managesieve_host'\]\ =\ 'dovecot:4190'\;/" /web/rc/config/config.inc.php
sed -i "/\$config\['managesieve_port'\].*$/d" /web/rc/config/config.inc.php
```
### Upgrade composer plugins
To upgrade roundcube plugins installed using composer and dependencies (e.g. RCMCardDAV plugin), you can simply run
composer in the container:
```bash
docker exec -it -w /web/rc $(docker ps -f name=php-fpm-mailcow -q) composer update --no-dev -o
```
### Upgrade mime type mappings
To upgrade the mime type mappings, re-download them using the command in the
[installation instructions](#Install-mime-type-mappings).
## Uninstalling roundcube
For the uninstallation, it is also assumed that the commands are executed in the mailcow installation directory and
that `mailcow.conf` has been sourced in the shell, see [Preparation](#Preparation) above.
### Remove the web directory
This deletes the roundcube installation and all plugins and dependencies that you may have installed,
including those installed with composer.
Note: This deletes also any custom configuration that you may have done in roundcube. If you want to preserve it, move it some
place else instead of deleting it.
```bash
rm -r data/web/rc
```
### Remove the database
Note: This clears all data stored for roundcube. If you want to preserve it, you could use `mysqldump` before deleting the data,
or simply keep the database.
```bash
docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -e "DROP USER 'roundcube'@'%';"
docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -e "DROP DATABASE roundcubemail;"
```
### Remove any custom configuration files we added to mailcow
To determine these, please read through the installation steps and revert what you changed there.
## Migration from older mailcow roundcube setup
Older versions of this instruction used the mailcow database also for roundcube, with a configured name prefix
`mailcow_rc1` on all roundcube tables.
For the migration, it is also assumed that the commands are executed in the mailcow installation directory and
that `mailcow.conf` has been sourced in the shell, see [Preparation](#Preparation) above. The commands of the different
steps build on each other and must be executed in the same shell. Particularly, some steps set shell variables (most
importantly the `DBROUNDCUBE` variable with the database password of the roundcube database user) used in later steps.
### Create new roundcube database user and database
Follow the [steps above](#Create-roundcube-database) to create the roundcube database user and the separate database.
### Migrate roundcube data from mailcow database
Before starting the database migration, we disable roundcube to avoid further changes to the roundcube database tables
during the migration.
```bash
cat <<EOCONFIG >data/conf/nginx/site.roundcube.custom
location ^~ /rc/ {
return 503;
}
EOCONFIG
docker compose exec nginx-mailcow nginx -s reload
```
Now we copy the roundcube data to the new database. We strip the database table prefix in the process, you may need to
adjust `mailcow\_rc1` in case you used a different prefix. It is also possible to keep the prefix (then also keep the
respective `db_prefix` roundcube setting).
```bash
RCTABLES=$(docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -sN mailcow -e "show tables like 'mailcow_rc1%';" | tr '\n\r' ' ')
docker exec $(docker ps -f name=mysql-mailcow -q) /bin/bash -c "mysqldump -uroot -p${DBROOT} mailcow $RCTABLES | sed 's/mailcow_rc1//' | mysql -uroot -p${DBROOT} roundcubemail"
```
### Update roundcube configuration
Run the following to remove the no longer required `db_prefix` option. We also enable logging of roundcube by removing
the settings `log_dir` and `temp_dir` that were part of the old setup instructions.
```bash
sed -i "/\$config\['db_prefix'\].*$/d" data/web/rc/config/config.inc.php
sed -i "/\$config\['log_dir'\].*$/d" data/web/rc/config/config.inc.php
sed -i "/\$config\['temp_dir'\].*$/d" data/web/rc/config/config.inc.php
```
We need to adapt the nginx configuration for roundcube to not expose the non-public folders of roundcube, specifically
those containing temporary files and log files:
```bash
cat <<EOCONFIG >data/conf/nginx/site.roundcube.custom
location /rc/ {
alias /web/rc/public_html/;
}
EOCONFIG
```
We can also update the `cipher_method` to a more secure one but mind that data previously encrypted by roundcube cannot
be decrypted anymore afterwards. This specifically affects stored CardDAV passwords if you use RCMCardDAV and your
users added custom addressbooks (the preset will be fixed automatically upon next login of the user). If you want to
change the `cipher_method`, run:
```bash
cat <<EOCONFIG >>data/web/rc/config/config.inc.php
\$config['cipher_method'] = 'chacha20-poly1305';
EOCONFIG
```
### Switch RCMCardDAV plugin to composer installation method
This is optional but will align your installation with these instructions and enable you to upgrade RCMCardDAV
using composer. This is simply done by deleting the carddav plugin from the installation and installing it using
composer according to the [instructions above](#Integrate-CardDAV-addressbooks-in-Roundcube), which include the creation
of a new RCMCardDAV v5 config. In case you modified your RCMCardDAV configuration file, you may want to backup it before
deleting the plugin and carry over your changes to the new configuration afterwards as well.
To delete the carddav plugin run the following command, then re-install according to the
[instructions above](#Integrate-CardDAV-addressbooks-in-Roundcube):
```bash
rm -r data/web/rc/plugins/carddav
```
### Switch roundcube to new database
First adapt the roundcube configuration to use the new database.
```bash
sed -i "/\$config\['db_dsnw'\].*$/d" data/web/rc/config/config.inc.php
cat <<EOCONFIG >>data/web/rc/config/config.inc.php
\$config['db_dsnw'] = 'mysql://roundcube:${DBROUNDCUBE}@mysql/roundcubemail';
EOCONFIG
```
### Re-enable roundcube web access
Execute the chown and chmod commands on sensitive roundcube directories listed in [Preparation](#Preparation), to
make sure the nginx webserver cannot access files it is not supposed to serve.
Then re-enable web access to roundcube by replacing our temporary roundcube custom config for the one described
[above](#Webserver-configuration), and reload the nginx configuration:
```bash
docker compose exec nginx-mailcow nginx -s reload
```
### Other changes
You must also adapt the configuration of the roundcube password plugin according to this instruction, specifically if
you use the password changing functionality, since the old instruction directly changed the password in the database,
whereas this version of the instruction uses the mailcow API for the password change.
Regarding other changes and additions (e.g., roundcube-dovecot\_client\_ip plugin), you can go through the current
installation instructions and adapt your configuration accordingly or perform the listed installation steps for new
additions.
Specifically, consider the following sections:
- [Ofelia job for roundcube housekeeping](#Ofelia-job-for-roundcube-housekeeping)
- [Allow plaintext authentication in dovecot](#Allow-plaintext-authentication-for-the-php-fpm-container-without-using-TLS),
if you adapt the roundcube configuration to contact dovecot via non-encrypted IMAP connection.
- [Forward the client network address to dovecot](#Forward-the-client-network-address-to-dovecot)
### Removing roundcube tables from mailcow database
After you have verified that the migration was successful and roundcube works using the separate database, you can remove
the roundcube tables from the mailcow database using the following command:
```bash
docker exec -it $(docker ps -f name=mysql-mailcow -q) mysql -uroot -p${DBROOT} -sN mailcow -e "SET SESSION foreign_key_checks = 0; DROP TABLE IF EXISTS $(echo $RCTABLES | sed -e 's/ \+/,/g');"
```

Datei anzeigen

@ -21,7 +21,7 @@ Escape-Zeichen ist '^]'.
## Meine Mails werden als Spam identifiziert
Bitte lesen Sie unsere [DNS-Konfiguration](../prerequisite/prerequisite-dns.de.md) Anleitung.
Bitte lesen Sie unsere [DNS-Konfiguration](../getting-started/prerequisite-dns.de.md) Anleitung.
## docker compose wirft seltsame Fehler aus.
@ -33,7 +33,7 @@ Bitte lesen Sie unsere [DNS-Konfiguration](../prerequisite/prerequisite-dns.de.m
Wenn Sie eine oder ähnliche Meldungen erhalten, während Sie versuchen, mailcow: dockerized auszuführen, überprüfen Sie bitte, ob Sie die **aktuellste** Version von **Docker** und **docker compose** haben.
## Container XY ist ungesund
## Container XY ist "unhealthy"
Dieser Fehler versucht Ihnen mitzuteilen, dass eine der (Gesundheits-)Bedingungen für einen bestimmten Container nicht erfüllt ist. Daher kann er nicht gestartet werden. Dies kann verschiedene Gründe haben, der häufigste ist ein aktualisierter Git-Klon, aber ein altes Docker-Image oder umgekehrt.
@ -50,7 +50,7 @@ Wenn Sie eine Fehlermeldung erhalten wie:
ERROR: for postfix-mailcow Cannot start service postfix-mailcow: driver failed programming external connectivity on endpoint mailcowdockerized_postfix-mailcow_1: Error starting userland proxy: listen tcp 0.0.0:25: bind: address already in use
```
während Sie versuchen, mailcow: dockerized zu starten / zu installieren, stellen Sie sicher, dass Sie unseren Abschnitt über [prerequisites](../prerequisite/prerequisite-system.de.md/#firewall-ports) befolgt haben.
Während Sie versuchen, mailcow: dockerized zu starten / zu installieren, stellen Sie sicher, dass Sie unseren Abschnitt über [prerequisites](../getting-started/prerequisite-system.de.md/#firewall-ports) befolgt haben.
## XYZ kann keine Verbindung zu ...

Datei anzeigen

@ -22,7 +22,7 @@ Escape character is '^]'.
## My mails are identified as Spam
Please read our guide on [DNS configuration](../prerequisite/prerequisite-dns.en.md).
Please read our guide on [DNS configuration](../getting-started/prerequisite-dns.en.md).
## docker compose throws weird errors
@ -51,7 +51,7 @@ If you get an error message like:
ERROR: for postfix-mailcow Cannot start service postfix-mailcow: driver failed programming external connectivity on endpoint mailcowdockerized_postfix-mailcow_1: Error starting userland proxy: listen tcp 0.0.0.0:25: bind: address already in use
```
while trying to start / install mailcow: dockerized, make sure you've followed our section on the [prerequisites](../prerequisite/prerequisite-system.en.md/#firewall-ports).
while trying to start / install mailcow: dockerized, make sure you've followed our section on the [prerequisites](../getting-started/prerequisite-system.en.md/#firewall-ports).
## XYZ can't connect to ...

Datei anzeigen

@ -28,6 +28,8 @@ theme:
- content.tabs.link
- search.share
- search.highlight
- toc.follow
- toc.integrate
markdown_extensions:
- abbr
@ -48,19 +50,17 @@ markdown_extensions:
- pymdownx.tabbed:
alternate_style: true
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
nav:
- 'Information & Support': 'index.md'
- 'Prerequisites':
- 'Prepare your system': 'prerequisite/prerequisite-system.md'
- 'DNS setup': 'prerequisite/prerequisite-dns.md'
- 'Installation, Update & Migration':
- 'Installation': 'i_u_m/i_u_m_install.md'
- 'Update': 'i_u_m/i_u_m_update.md'
- 'Migration': 'i_u_m/i_u_m_migration.md'
- 'Deinstallation': 'i_u_m/i_u_m_deinstall.md'
- 'Home': 'index.md'
- 'Getting started':
- 'Prepare your system': 'getting-started/prerequisite-system.md'
- 'DNS setup': 'getting-started/prerequisite-dns.md'
- 'Installation': 'getting-started/i_u_m_install.md'
- 'Update': 'getting-started/i_u_m_update.md'
- 'Deinstallation': 'getting-started/i_u_m_deinstall.md'
- 'Post Installation Tasks':
- 'Advanced SSL': 'post_installation/firststeps-ssl.md'
- 'Disable IPv6': 'post_installation/firststeps-disable_ipv6.md'
@ -68,13 +68,7 @@ nav:
- 'IP bindings': 'post_installation/firststeps-ip_bindings.md'
- 'Local MTA on Docker host': 'post_installation/firststeps-local_mta.md'
- 'Logging': 'post_installation/firststeps-logging.md'
- 'Reverse Proxy':
- 'Overview': 'post_installation/reverse-proxy/r_p.md'
- 'Apache 2.4': 'post_installation/reverse-proxy/r_p-apache24.md'
- 'Nginx': 'post_installation/reverse-proxy/r_p-nginx.md'
- 'HAProxy (community supported)': 'post_installation/reverse-proxy/r_p-haproxy.md'
- 'Traefik v2 (community supported)': 'post_installation/reverse-proxy/r_p-traefik2.md'
- 'Caddy v2 (community supported)': 'post_installation/reverse-proxy/r_p-caddy2.md'
- 'Reverse Proxy': 'post_installation/firststeps-rp.md'
- 'Rspamd UI': 'post_installation/firststeps-rspamd_ui.md'
- 'SNAT': 'post_installation/firststeps-snat.md'
- 'Sync job migration': 'post_installation/firststeps-sync_jobs_migration.md'
@ -94,16 +88,16 @@ nav:
- 'Remove Persistent Data': 'troubleshooting/debug-rm_volumes.md'
- 'Reset Passwords (incl. SQL)': 'troubleshooting/debug-reset_pw.md'
- 'Reset TLS certificates': 'troubleshooting/debug-reset_tls.md'
- 'Backup & Restore':
- 'Component backup & restore':
- 'Backup': 'backup_restore/b_n_r-backup.md'
- 'Restore': 'backup_restore/b_n_r-restore.md'
- 'Cold-standby (rolling backup)': 'backup_restore/b_n_r-coldstandby.md'
- 'Backup, Restore & Migration':
- 'Backup': 'backup_restore_migrate/b_r_m-backup.md'
- 'Restore': 'backup_restore_migrate/b_r_m-restore.md'
- 'Migration': 'backup_restore_migrate/b_r_m_migration.md'
- 'Cold-standby (rolling backup)': 'backup_restore_migrate/b_r_m-coldstandby.md'
- 'Manual backups':
- 'Maildir': 'backup_restore/b_n_r-backup_restore-maildir.md'
- 'MySQL (mysqldump)': 'backup_restore/b_n_r-backup_restore-mysql.md'
- 'Maildir': 'backup_restore_migrate/b_r_m-backup_restore-maildir.md'
- 'MySQL (mysqldump)': 'backup_restore_migrate/b_r_m-backup_restore-mysql.md'
- 'mailcow-internal backups':
- 'Recover accidentally deleted data': 'backup_restore/b_n_r-accidental_deletion.md'
- 'Recover accidentally deleted data': 'backup_restore_migrate/b_r_m-accidental_deletion.md'
- 'Manual/Guides/Examples':
- 'mailcow UI':
- 'Blacklist / Whitelist': 'manual-guides/mailcow-UI/u_e-mailcow_ui-bl_wl.md'
@ -186,15 +180,14 @@ plugins:
default_language: en
languages:
en: English
de:
de:
name: Deutsch
site_name: "mailcow: dockerized Dokumentation"
nav_translations:
#### Begin of german translation
de:
'Information & Support': 'Informationen & Support'
### Prerequisites Section
'Prerequisites': 'Voraussetzungen'
'Getting started': 'Erste Schritte'
'Prepare your system': 'Systemvoraussetzungen'
'DNS setup': 'DNS Einstellungen'
### Installation Section
@ -205,11 +198,6 @@ plugins:
'Disable IPv6': 'IPv6 deaktivieren'
'IP bindings': 'IP-Bindings'
'Local MTA on Docker host': 'Lokaler MTA auf Docker-Host'
### Reverse Proxy Subsection
'Overview': 'Übersicht'
'HAProxy (community supported)': 'HAProxy (von der Community unterstützt)'
'Traefik v2 (community supported)': 'Traefik v2 (von der Community unterstützt)'
'Caddy v2 (community supported)': 'Caddy v2 (von der Community unterstützt)'
'Sync job migration': 'Migration mit Sync Jobs'
### Models Section
'Models': 'Modelle'
@ -281,6 +269,7 @@ plugins:
'Run scripts before and after updates': 'Skripte vor und nach Aktualisierungen ausführen'
### Client Configuration Section
'Client Configuration': 'Client-Konfiguration'
'Overview': 'Übersicht'
'Manual configuration': 'Manuelle Konfiguration'
### Third party apps Section
'Third party apps': 'Anwendungen von Drittanbietern'
@ -291,26 +280,22 @@ plugins:
timezone: Europe/Berlin
- redirects:
redirect_maps:
# 'old': 'new'
# LEGACY
'u_e-mailpiler-integration.md': 'third_party/mailpiler/third_party-mailpiler_integration.en.md'
'b_n_r_accidental_deletion.md': 'backup_restore/b_n_r-accidental_deletion.en.md'
'b_r_m_accidental_deletion.md': 'backup_restore_migrate/b_r_m-accidental_deletion.en.md'
'debug-reset-tls.md': 'troubleshooting/debug-reset_tls.en.md'
# NEW DUE TO NEW LAYOUT
'mailcow-dockerized-docs/i_u_m/i_u_m_install.md': 'i_u_m/i_u_m_install.en.md' # https://github.com/mailcow/mailcow-dockerized/pull/5196
'prerequisite-system.md': 'prerequisite/prerequisite-system.en.md'
'prerequisite-dns.md': 'prerequisite/prerequisite-dns.en.md'
'i_u_m_install.md': 'i_u_m/i_u_m_install.en.md'
'i_u_m_update.md': 'i_u_m/i_u_m_update.en.md'
'i_u_m_migration.md': 'i_u_m/i_u_m_migration.en.md'
'i_u_m_deinstall.md': 'i_u_m/i_u_m_deinstall.en.md'
'prerequisite-system.md': 'getting-started/prerequisite-system.en.md'
'prerequisite-dns.md': 'getting-started/prerequisite-dns.en.md'
'install.md': 'getting-started/i_u_m_install.en.md'
'i_u_m/i_u_m_install.md': 'getting-started/i_u_m_install.en.md'
'update.md': 'getting-started/i_u_m_update.en.md'
'deinstall.md': 'getting-started/i_u_m_deinstall.en.md'
'firststeps-ssl.md': 'post_installation/firststeps-ssl.en.md'
'firststeps-disable_ipv6.md': 'post_installation/firststeps-disable_ipv6.en.md'
'firststeps-dmarc_reporting.md': 'post_installation/firststeps-dmarc_reporting.en.md'
'firststeps-ip_bindings.md': 'post_installation/firststeps-ip_bindings.en.md'
'firststeps-local_mta.md': 'post_installation/firststeps-local_mta.en.md'
'firststeps-logging.md': 'post_installation/firststeps-logging.en.md'
'firststeps-rp.md': 'post_installation/reverse-proxy/r_p.en.md'
'firststeps-rp.md': 'post_installation/firststeps-rp.en.md'
'firststeps-rspamd_ui.md': 'post_installation/firststeps-rspamd_ui.en.md'
'firststeps-snat.md': 'post_installation/firststeps-snat.en.md'
'firststeps-sync_jobs_migration.md': 'post_installation/firststeps-sync_jobs_migration.en.md'
@ -328,13 +313,13 @@ plugins:
'debug-rm_volumes.md': 'troubleshooting/debug-rm_volumes.en.md'
'debug-reset_pw.md': 'troubleshooting/debug-reset_pw.en.md'
'debug-reset_tls.md': 'troubleshooting/debug-reset_tls.en.md'
'b_n_r_backup.md': 'backup_restore/b_n_r-backup.en.md'
'b_n_r-backup.md': 'backup_restore/b_n_r-backup.en.md'
'b_n_r-restore.md': 'backup_restore/b_n_r-restore.en.md'
'b_n_r-coldstandby.md': 'backup_restore/b_n_r-coldstandby.en.md'
'b_n_r-backup_restore-maildir.md': 'backup_restore/b_n_r-backup_restore-maildir.en.md'
'b_n_r-backup_restore-mysql.md': 'backup_restore/b_n_r-backup_restore-mysql.en.md'
'b_n_r-accidental_deletion.md': 'backup_restore/b_n_r-accidental_deletion.en.md'
'b_n_r_backup.md': 'backup_restore_migrate/b_r_m-backup.en.md'
'b_n_r-restore.md': 'backup_restore_migrate/b_r_m-restore.en.md'
'migration.md': 'backup_restore_migrate/b_r_m_migration.en.md'
'b_n_r-coldstandby.md': 'backup_restore_migrate/b_r_m-coldstandby.en.md'
'b_n_r-backup_restore-maildir.md': 'backup_restore_migrate/b_r_m-backup_restore-maildir.en.md'
'b_n_r-backup_restore-mysql.md': 'backup_restore_migrate/b_r_m-backup_restore-mysql.en.md'
'b_n_r-accidental_deletion.md': 'backup_restore_migrate/b_r_m-accidental_deletion.en.md'
'u_e-mailcow_ui-bl_wl.md': 'manual-guides/mailcow-UI/u_e-mailcow_ui-bl_wl.en.md'
'u_e-mailcow_ui-config.md': 'manual-guides/mailcow-UI/u_e-mailcow_ui-config.en.md'
'u_e-mailcow_ui-css.md': 'manual-guides/mailcow-UI/u_e-mailcow_ui-css.en.md'
@ -398,11 +383,9 @@ plugins:
'third_party-portainer.md': 'third_party/portainer/third_party-portainer.en.md'
'third_party-roundcube.md': 'third_party/roundcube/third_party-roundcube.en.md'
- search:
# separator: '[\s\-,:!=\[\]()"/]+|(?!\b)(?=[A-Z][a-z])|\.(?!\d)|&[lg]t;'
lang:
- en
- de
separator: '[\s\-,:!=\[\]()"/]+|(?!\b)(?=[A-Z][a-z])|\.(?!\d)|&[lg]t;'
- social
- glightbox
extra:

Datei anzeigen

@ -1,7 +1,7 @@
mkdocs-material==9.1.18
mkdocs-material==9.1.14
mkdocs-redirects==1.2.0
pygments==2.15.1
mkdocs-static-i18n==0.56
mkdocs-git-revision-date-localized-plugin==1.2.0
pillow==10.0.0
pillow==9.5.0
cairosvg==2.7.0