Question
How to get a list of mail accounts with enabled/disabled mailboxes in Plesk?
Answer
-
Note: Additional step for a Windows server: start the Command Prompt.
To list all mailboxes with the enabled status run the command below:
plesk db -Ne "select concat(m.mail_name,'@',d.name) as mailbox, m.postbox from domains d, mail m, accounts a where m.dom_id=d.id and m.account_id=a.id and m.postbox='true'"
To list all mailboxes with the disabled status run the command below:
plesk db -Ne "select concat(m.mail_name,'@',d.name) as mailbox, m.postbox from domains d, mail m, accounts a where m.dom_id=d.id and m.account_id=a.id and m.postbox='false'"