This script retrieves & prints a list of all the email addresses created in a cPanel server. The list consists of lines formatted as: owner,user,email.
Clone this project and install the package:
git clone [email protected]:luissquall/whm-emails.git
cd whm-emails
npm install
Copy config. template and set program settings:
cp config.json.default config.json
vim config.json
Let it be:
chmod u+x cli.js
./cli.js
# Save the list in a file
./cli.js > emails.csv
api
: URL of the WHM address of your server. E.g. https://server.monkey.com:2087/credentials.hash
: Server's remote access key
The program requests a list of all the accounts in the server, extracts the users from the list and issues a new request per user to Email::listpopssingle to obtain all email accounts from the user's account.