Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Bulk delete email accounts from cPanel in SSH?

Discussion in 'E-mail Discussion' started by YouHost, May 21, 2018.

  1. YouHost

    YouHost Member

    Joined:
    Apr 2, 2012
    Messages:
    6
    Likes Received:
    2
    Trophy Points:
    53
    cPanel Access Level:
    Root Administrator
    Hi,
    I have found the following procedure to bulk delete email account for a domain.

    1. Create a text file, delemails.txt, with each account name on its own line:

    account_003
    account_004
    account_012
    account_027
    etc...

    2. FTP that file onto your server into a convenient location.

    3. SSH onto the server and cd to the location where is placed delemails.txt

    4. Run this command from the SSH shell:

    for i in `cat delemails.txt`; do /usr/local/cpanel/cpanel-email delpop "$i" 0 mydomain.com ; done

    Do you thinks is it safe to use that?
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,888
    Likes Received:
    90
    Trophy Points:
    78
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,838
    Likes Received:
    275
    Trophy Points:
    193
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hello

    As stated by @24x7server the cpapi2 delpop function can also be used but you'd need to create a loop for it as well.


    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice