I'm trying to get a list of all email accounts on the server including their disk usage and restriction status (unrestricted, restricted, etc)
I currently use this:
This gets me a list of email address, but it has two issues:
1. It does not list the size and restriction status
2. It outputs errors, even though it still seems to work:
Can anyone provide assistance? Preferably output would be a CSV.
I currently use this:
for i in $(find /var/cpanel/users -type f | egrep -o '[a-zA-Z0-9]+$' | grep -v system);do whmapi1 list_pops_for user=$i;done
This gets me a list of email address, but it has two issues:
1. It does not list the size and restriction status
2. It outputs errors, even though it still seems to work:
Code:
warn [Internal Warning while parsing [stdin] 194064] (XID 4yk3gp) The sys
tem failed to create the file “/home2/username/.cpanel/email_accounts.json.lock” (as EUID: 520,
EGID: 533 533) because of the following error: No such file or directory at /usr/local/cpanel/Cpanel
/Email/Accounts.pm line 155.
Last edited by a moderator: