I need to find the total number of email accounts in a cPanel Linux server.
This must include only the active accounts. i.e. only those accounts whose MX is pointing to this server.
You can do it using following one liner.
I have tried this script which checks the users in '/etc/userdomains' and displays the count of total mail accounts in the server.
but I am looking for a script which could search the /etc/localdomains.