• Community Support
  • USEnglish
  • How to export all domains and accounts in Maildir format?

The maildir structure is in vmail volume.
However its encrypted. The encryption key is in crypt volume.

Have something to say?

Join the community by quickly registering to participate in this discussion. We'd like to see you joining our great moo-community!

DocFraggle

how to descrypt all that properly? Simply rinning this script?

# Decrypt /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

    kantamaru267 crypt:private_key_path=/mail_crypt/ecprivkey.pem:public_key_path=/mail_crypt/ecpubkey.pem

    Here? Or what do you mean?

    Actually, I don’t

    1)

    private_key_path=/mail_crypt/

    what’s this path? how can it exist?

    2) in the script that’s supposed to descrypt emails:
    find /var/vmail/ ....

    where it comes from? it doesn’t exist either

    # ls /var/vmail
    ls: cannot access '/var/vmail': No such file or directory

    or should I first a) backup emails b) extract them on my local machie and then c) replace the find /var/vmail/ with the path I’ll have extracted them in?

    On my server, the root directory of an instance of mailcow is at /opt/mailcow-dockerized/

      No one is typing