Warning
Письма хранятся в сжатом (lz4) и зашифрованном виде. Ключевую пару можно найти в crypt-vol-1.
Если вы хотите расшифровать/зашифровать существующие файлы maildir, вы можете использовать следующий скрипт на свой страх и риск:
Войдите в Dovecot, выполнив следующую команду в директории animails:
``` bash
docker compose exec dovecot-animails /bin/bash ```
``` bash
docker-compose exec dovecot-animails /bin/bash ```
```
Расшифровать /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 get compress lz4:1:crypt:private_key_path=/mail_crypt/ecprivkey.pem:public_key_path=/mail_crypt/ecpubkey.pem:posix:prefix=/ "$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
Зашифровать /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 ```