2022-07-23 01:17:49 +02:00
|
|
|
!!! warning "Achtung"
|
|
|
|
Die Mails werden komprimiert (lz4) und verschlüsselt gespeichert. Das Schlüsselpaar ist in crypt-vol-1 zu finden.
|
2022-02-02 11:37:12 +01:00
|
|
|
|
|
|
|
Wenn Sie vorhandene maildir-Dateien entschlüsseln/verschlüsseln wollen, können Sie das folgende Skript auf eigene Gefahr verwenden:
|
|
|
|
|
2022-12-15 15:31:09 +01:00
|
|
|
Wechseln Sie in den Dovecot Container, indem Sie folgenden Befehl im mailcow-dockerized Verzeichnis ausführen:
|
|
|
|
|
|
|
|
=== "docker compose (Plugin)"
|
|
|
|
|
|
|
|
``` bash
|
|
|
|
docker compose exec dovecot-mailcow /bin/bash
|
|
|
|
```
|
|
|
|
|
|
|
|
=== "docker-compose (Standalone)"
|
|
|
|
|
|
|
|
``` bash
|
|
|
|
docker-compose exec dovecot-mailcow /bin/bash
|
|
|
|
```
|
|
|
|
|
2022-02-02 11:37:12 +01:00
|
|
|
|
|
|
|
```
|
|
|
|
# Entschlüsseln Sie /var/vmail
|
|
|
|
find /var/vmail/ -type f -regextype egrep -regex '.*S=.*W=.*' | while read -r file; do
|
|
|
|
if [[ $(head -c7 "$file") == "CRYPTED" ]]; then
|
2022-09-12 01:05:23 +02:00
|
|
|
doveadm fs get compress lz4:1:crypt:private_key_path=/mail_crypt/ecprivkey.pem:public_key_path=/mail_crypt/ecpubkey.pem:posix:prefix=/ \
|
2022-02-02 11:37:12 +01:00
|
|
|
"$file" > "/tmp/$(basename "$file")"
|
|
|
|
if [[ -s "/tmp/$(basename "$file")" ]]; then
|
|
|
|
chmod 600 "/tmp/$(basename "$file")"
|
|
|
|
chown 5000:5000 "/tmp/$(basename "$file")"
|
|
|
|
mv "/tmp/$(basename "$file")" "$file"
|
|
|
|
else
|
|
|
|
rm "/tmp/$(basename "$file")"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
# Verschlüsseln von /var/vmail
|
|
|
|
find /var/vmail/ -type f -regextype egrep -regex '.*S=.*W=.*' | while read -r file; do
|
|
|
|
if [[ $(head -c7 "$file") != "CRYPTED" ]]; then
|
|
|
|
doveadm fs put crypt private_key_path=/mail_crypt/ecprivkey.pem:public_key_path=/mail_crypt/ecpubkey.pem:posix:prefix=/ \
|
|
|
|
"$file" "$file"
|
|
|
|
chmod 600 "$file"
|
|
|
|
chown 5000:5000 "$file"
|
|
|
|
fi
|
|
|
|
done
|
2022-07-23 01:17:49 +02:00
|
|
|
```
|