get list of email accounts

ca2236

Well-Known Member
Feb 2, 2018
216
22
18
Nebraska
cPanel Access Level
DataCenter Provider
Hi,

I was wondering if it was possible to get a listing of email accounts per cPanel account in an easy way? I think you could maybe list them under /home/mail maybe, but was wondering if there was a command line script or something that listed all email accounts on the system. The below link shows /scripts/addpop to add an email via cli. I was wondering about something like 'getpop'.



Thanks


UPDATE:

I found this in the api, this can be scripted to cycle through the accounts.

Code:
uapi --user=account Email list_pops

was hoping for a flat file like /etc/localdomains or /etc/userdomains (or something like that, or a pre-existing script/command that would run on the whole system without scripting)
 
Last edited:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
3,262
404
243
cPanel Access Level
Root Administrator
Hey there! The API call is your best best as there isn't a flat file like what you mentioned. You could see individual accounts with their respective directories in /home/usrename/mail/domain.com, but that's not nearly as pretty of a list of what the API creates.