-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added docs about lazy-expunge plugin * fix: two corrections of unsupported stuff * Corrected mailcow Version Tag
- Loading branch information
1 parent
5c503a0
commit 68b5fc1
Showing
3 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
!!! danger "Vorsicht" | ||
Diese Anleitung befindet sich noch in Arbeit, Fehler können passieren! Nutzen Sie diese Funktion mit Bedacht! | ||
|
||
!!! info "Hinweis" | ||
Diese Funktion ist ab mailcow-Versionen 2024-11 kompatibel. Ältere Versionen sind theoretisch ebenfalls in der Lage, die Funktion zu nutzen. Aufgrund interner Änderungen ist die Implementierung jedoch schwieriger und wird hier nicht weiter beschrieben, da nicht unterstüzt. | ||
|
||
## Vorwort | ||
Dovecot unterstützt seit [geraumer Zeit](https://doc.dovecot.org/2.3/configuration_manual/lazy_expunge_plugin/) eine Funktion namens *Lazy Expunge*, welche es dem Serveradministrator ermöglicht, gelöschte E-Mails eines Benutzerkontos nach der eigentlichen Löschung zurückzuhalten. | ||
|
||
mailcow besitzt eine ähnliche Funktion, die jedoch für Benutzer nicht so leicht zugänglich ist (siehe [Versehentlich gelöschte Daten wiederherstellen (Mail)](../../backup_restore/b_n_r-accidental_deletion.de.md#mail)) und eher als Fallback-Methode für Administratoren dient. | ||
|
||
Mit der Dovecot-Option können Benutzer selbst als gelöscht markierte E-Mails einsehen und wiederherstellen, bevor diese dann automatisch vom Dovecot-Server gelöscht werden. | ||
|
||
## Einrichtung | ||
|
||
1. Bearbeiten Sie die `extra.conf` im Dovecot-Konfigurationsordner (in der Regel unter `MAILCOW_ROOT/data/conf/dovecot`) mit folgendem Inhalt: | ||
```bash | ||
plugin { | ||
# Kopiere alle gelöschten Mails in die .EXPUNGED Mailbox | ||
lazy_expunge = .EXPUNGED | ||
|
||
# Als gelöscht markierte Mails von der Quota ausschließen | ||
quota_rule = .EXPUNGED:ignore | ||
} | ||
|
||
# Definiert die .EXPUNGED Mailbox | ||
namespace inbox { | ||
mailbox .EXPUNGED { | ||
# Definiert, wie lange Mails in diesem Ordner bleiben sollen, bevor sie gelöscht werden. | ||
# Zeit wird definiert nach: https://doc.dovecot.org/2.3/settings/types/#time | ||
autoexpunge = 7days | ||
# Definiert, wie viele Mails maximal in der EXPUNGED Mailbox gehalten werden sollen, bevor diese geleert wird | ||
autoexpunge_max_mails = 100000 | ||
} | ||
} | ||
``` | ||
|
||
2. Starten Sie den Dovecot-Container neu: | ||
|
||
=== "docker compose (Plugin)" | ||
|
||
```bash | ||
docker compose restart dovecot-mailcow | ||
``` | ||
|
||
=== "docker-compose (Standalone)" | ||
|
||
```bash | ||
docker-compose restart dovecot-mailcow | ||
``` | ||
|
||
3. Nun sollte, wenn der Papierkorb geleert wird, ein neuer Ordner mit dem Namen `.EXPUNGED` erscheinen. In diesem Ordner sind die E-Mails enthalten, die gemäß der in Schritt 1 definierten Regeln nach einer gewissen Zeit automatisch vom Server gelöscht werden. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
!!! danger | ||
This guide is still a work in progress, and errors may occur! Use this feature with caution! | ||
|
||
!!! info | ||
This feature is compatible with mailcow versions starting from 2024-11. Older versions are theoretically capable of using it as well, but due to internal changes, the implementation is more complicated, so it won't be stated here as unsupported. | ||
|
||
## Introduction | ||
Dovecot has supported a feature called *Lazy Expunge* for [quite some time](https://doc.dovecot.org/2.3/configuration_manual/lazy_expunge_plugin/), which allows server administrators to temporarily retain deleted emails from a user account even after they have been deleted. | ||
|
||
mailcow also has a similar feature, but it is not easily accessible to users (see [Recover accidentally deleted data (Mail)](../../backup_restore/b_n_r-accidental_deletion.en.md#mail)) and serves more as a fallback method for administrators. | ||
|
||
With the Dovecot option, users can view and restore emails that have been marked as deleted before they are automatically purged by the Dovecot server. | ||
|
||
## Setup | ||
|
||
1. Edit the `extra.conf` file in the Dovecot configuration folder (usually located at `MAILCOW_ROOT/data/conf/dovecot`) with the following content: | ||
```bash | ||
plugin { | ||
# Copy all deleted emails to the .EXPUNGED mailbox | ||
lazy_expunge = .EXPUNGED | ||
|
||
# Exclude marked-as-deleted emails from the quota | ||
quota_rule = .EXPUNGED:ignore | ||
} | ||
|
||
# Define the .EXPUNGED mailbox | ||
namespace inbox { | ||
mailbox .EXPUNGED { | ||
# Define how long emails will stay in this folder before they are deleted. Time is defined according to: https://doc.dovecot.org/2.3/settings/types/#time | ||
autoexpunge = 7days | ||
# Define how many emails can be kept in the EXPUNGED folder before it is cleared | ||
autoexpunge_max_mails = 100000 | ||
} | ||
} | ||
``` | ||
|
||
2. Restart the Dovecot container: | ||
|
||
=== "docker compose (Plugin)" | ||
|
||
```bash | ||
docker compose restart dovecot-mailcow | ||
``` | ||
|
||
=== "docker-compose (Standalone)" | ||
|
||
```bash | ||
docker-compose restart dovecot-mailcow | ||
``` | ||
|
||
3. Once the trash is emptied, a new folder named `.EXPUNGED` should appear. This folder will contain emails that, according to the rules defined in step 1, will be automatically deleted from the server after a certain period. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters