1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Doubt

Discussion in 'Plesk 11.x for Linux' started by DiegoAlves, Jan 10, 2013.

  1. DiegoAlves

    DiegoAlves New Pleskian

    11
     
    Joined:
    Dec 23, 2012
    Messages:
    16
    Likes Received:
    0
    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.
     
  2. IgorG

    IgorG Forums Analyst Staff Member

    49
    24%
    Joined:
    Oct 27, 2009
    Messages:
    24,572
    Likes Received:
    1,243
    Location:
    Novosibirsk, Russia
    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.
     
Loading...