cPanel – every email address in the server

 

cat /etc/userdomains | sed "s/://g" | awk {'system("ls -1d /home/"$2"/mail/"$1"/* 2> /dev/null")'} | sed "s/\// /g" | awk {'print $5"@"$4'}

The above command will print our every email address in the server.
* Don’t forget you’ll want the email aliases aswell (found under /etc/valiases/).

Reference: https://forums.cpanel.net/threads/export-list-of-all-email-addresses.351951/

 

Leave a Reply

Your email address will not be published. Required fields are marked *


*