Question
How to hash all the existing email accounts passwords in Plesk that still use symmetric encryption?
Answer
A new feature that allows password hashing for newly created email accounts and when their passwords are changed was added in Plesk 18.0.72. The Mass Email Accounts Passwords Hash script can be used to hash existing email accounts passwords that are stored in a symmetrically encrypted form.
All email account passwords that were saved with symmetric encryption will be hashed once the command is run. The plaintext form of these passwords will not change.
Warning: Because this operation is irreversible, it is highly advised to create a system database backup before executing this script.
Warning: If the SOGo extension is installed and being used on the server as a webmail client in place of RoundCube, do not execute this script. SOGo does not currently support hashed passwords, and the execution of the script may result in the loss of authentication for email accounts in SOGo.
- Connect to the Plesk server via SSH.
- Create a system database backup.
-
Download the following script:
# wget https://raw.githubusercontent.com/plesk/kb-scripts/master/hash-sym-email-accounts-passwords/hash-sym-email-accounts-passwords.sh && chmod +x hash-sym-email-accounts-passwords.sh
-
Execute the downloaded script:
# bash hash-sym-email-accounts-passwords.sh
Comments
There are several things this script could be improved:
"Your password is not complex enough. According to the server policy, the minimal password strength is Strong (recommended)."
Unable to find domain with name 'example.com'
exit status 4
Exists as an alias, but Mail service is disabled
--> I needed to enable Mail Service temporarily. Hashing was then already done automatically. After disabling the Mail Service again, the entry vanished from /usr/local/psa/admin/sbin/mail_auth_view
Hashing password for medienspiegel@verylonglonglonglon......
Failed to convert domain name from IDN to Punycode
--> Why is the domain name truncated? There are several domains with different endings and I cannot see which one is affected. Also, none of these domains is an IDN so probably some kind of false positive.
A - account disabled
D - domain disabled
E - password encrypted
--> E should be "hashed" and not "encrypted"! Password were encrypted before, with this script they get hashed.
Warning: After hashing passwords, users trying to login with CRAM-MD5 will not be able to authenticate! For SMTP, there will be errors in the mail log: “SASL CRAM-MD5 authentication failed: authentication failure”
Apple Mail uses CRAM-MD5 when set to “automatic”, so these users will get problems.
CRAM-MD5 requires the server to know the actual password, not just the hashed value of the password.
Please sign in to leave a comment.