• Dear Pleskians! The Plesk Forum will be undergoing scheduled maintenance on Monday, 7th of July, at 9:00 AM UTC. The expected maintenance window is 2 hours.
    Thank you in advance for your patience and understanding on the matter.

Doubt

DiegoAlves

New Pleskian
Guys, how are you?
I'm having the following problem:
Tenhos multiple email accounts (more than 600) that needs cleaning / delete.
Not all domain accounts.
The particularity is that I have these accounts begin with numbers.

Thanks.
 
What about using /usr/local/psa/bin/mail CLI utility. Use script something like:

for i in `mysql -uadmin -p\`cat /etc/psa/.psa.shadow\` psa -Ns -e "select concat(mail.mail_name,"@",domains.name) as address from mail,domains,accounts where mail.dom_id=domains.id and mail.account_id=accounts.id order by address"`; do /usr/local/psa/bin/mail -r $i;done

It will remove all mail accounts for all domain.
 
Back
Top