habibzain Just husband, father and enthusiastic men about System Administration. Love to write short article about it. Perhaps can help and be useful for others.

cPanel Get All Email Address and Mail Forwarder

46 sec read

Get All Email Address and Mail Forwarder in cPanel

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.

Buy Me a Coffee at ko-fi.com

https://saweria.co/habibzain
https://ko-fi.com/habibzain
See also  Alma Linux 8 - Postfix SMTP Server
habibzain Just husband, father and enthusiastic men about System Administration. Love to write short article about it. Perhaps can help and be useful for others.

Easy Create Laravel Project with Composer

Requirement Laravel, a popular PHP framework, is renowned for its elegant syntax and robust features, making it a top choice for web developers. One...
habibzain
1 min read

Virtualbox Change Storage Size

Changing the storage size of a virtual machine in VirtualBox involves a few steps. Here’s a general guide. Backup your Virtual Machine (VM) Before...
habibzain
35 sec read

Easy Setup Logrotate Nginx Ubuntu

Log rotation is an important aspect of managing log files on a Linux system, including those generated by Nginx. Logrotate is a utility that...
habibzain
1 min read

Leave a Reply

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

Never miss good article from us, get weekly updates in your inbox