[How to] Reset passwords for all mail accounts in case Plesk Mass Password Reset Script did not work

Created:

2016-11-16 12:41:58 UTC

Modified:

2017-08-16 16:20:14 UTC

0

Was this article helpful?


Have more questions?

Submit a request

[How to] Reset passwords for all mail accounts in case Plesk Mass Password Reset Script did not work

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.x for Linux
  • Plesk 12.0 for Linux

Question

How to reset passwords for all mail accounts in Plesk if the solution from Plesk Mass Password Reset Script did not reset passwords for all mail accounts.

Answer

  1. Get the list of all mail accounts registered in Plesk database:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -Ne"select concat (mail.mail_name,'@',domains.name) from domains,mail where mail.dom_id=domains.id" > mailboxes.txt
  2. Reset passwords using the following command:

    cat mailboxes.txt | while read LINE; do /usr/local/psa/bin/mail --update $LINE -passwd `cat /dev/urandom | tr -dc 'a-zA-Z0-9-!@#$%^&*()_+' | fold -w 10 | head -n1`; done
Have more questions? Submit a request
Please sign in to leave a comment.