Plesk

Unable to receive email: the recipient email account has an empty password in the Plesk database

Symptoms

Cause

The recipient email account has an empty password in the Plesk database.

Resolution

For a single email account

  1. Log into Plesk.

  2. Go to Domains > example.com > Email Addresses > johndoe@example.com.

  3. Set a new password into Password and Confirm password fields and press the OK button:

For all affected email accounts

  1. Log into the server via SSH.

  2. Create a backup for psa database:

    # plesk db dump psa > /root/psa.sql

  3. Execute the command below to create a /root/affectedaccounts.txt file that contains all email accounts with the empty passwords:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin psa -Ne "select concat(m.mail_name,'@',d.name) as mailbox from domains d, mail m, accounts a where m.dom_id=d.id and m.account_id=a.id and m.postbox='true' and a.password =''" > /root/affectedaccounts.txt

  4. Run the following command to set a new password for the email accounts from /root/affectedaccounts.txt file:

    # while read i; do /usr/local/psa/bin/mail -u $i -passwd "NEWPASSWORD"; done < /root/affectedaccounts.txt

  5. Generate as list with mailboxes that currently are in the disabled state but have empty passwords:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin psa -Ne "select concat(m.mail_name,'@',d.name) as mailbox from domains d, mail m, accounts a where m.dom_id=d.id and m.account_id=a.id and m.postbox='false' and a.password =''" > /root/affectedaccountsdisabled.txt

  6. Execute the command below to set a new passwords for the disabled mailboxes as well:

    # wget https://support.plesk.com/hc/en-us/article_attachments/4407744658066/script213928485.tar.gz && tar -xvzf script213928485.tar.gz && chmod +x script.sh && bash script.sh

    Note: in the commands from steps №4 and №6 replace NEWPASSWORD with the desired password that will be set for all affected email accounts.