Jonuji You would need to decrypt all files in your old vmail directory of the snapshot using the old private key, then reencrypt them with the new private key and move them to your new vmail directory.
See https://docs.mailcow.email/manual-guides/Dovecot/u_e-dovecot-mail-crypt/
As the above examples are done inside the dovecot container you would need to do the decryption from the snapshot host system, so install dovecot to be able to use doveadm, and alter the path for “public_key_path” and “private_key_path” (located at /var/lib/docker/volumes/mailcowdockerized_crypt-vol-1/data/) and the search base to “/var/lib/docker/volumes/mailcowdockerized_vmail-vol-1/data”
So decrypting on the broken host system should look like
cd /var/lib/docker/volumes/mailcowdockerized_vmail-vol-1/_data
find /var/lib/docker/volumes/mailcowdockerized_vmail-vol-1/_data/ -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=/var/lib/docker/volumes/mailcowdockerized_crypt-vol-1/_data/ecprivkey.pem:public_key_path=/var/lib/docker/volumes/mailcowdockerized_crypt-vol-1/_data/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
No guarantees though