Hi Dude. I want to share tips on how to get all email address and mail forwarder in cPanel. This is simple method to export all email addresses on all cpanel accounts. Just run one line of the program, you can immediately display all cpanel email addresses.
Execute Simply Command to Get All Email Address
root@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'}
Yes, our mail address will show.
Dump File Exported List
Or we can dump to file, and then send mail with attachment that file via command line linux.
root#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'} > /srv/190722emailaddress.txt
Send Mail With Attachment via Command Line
root@server# mail -a /srv/190722emailaddress.txt -s 'email address190722' [email protected]
###type text here###
This is body mail.
.
EOT
Secondly, if we want to show all mail forwarders is under /etc/valiases/
. We can use favourite editor like vim
or nano to edit
it.
source: https://forums.cpanel.net/threads/export-list-of-all-email-addresses.351951/
Let's Buy Me Coffee. https://saweria.co/habibzain https://ko-fi.com/habibzain