List of all hosted email addresses
This four liner produces a list of your email addresses, it is helpful if you are using an external spam filter
#!/bin/bash
find /etc/valiases/* -type f | xargs -ifile sed -e 's/:.*//' file > /usr/src/getAllEmail.txt
ls -d /home/*/mail/*/*/ | awk 'BEGIN { ; } ; { ; tcmd = "test -d " $1 ; if(!system(tcmd)){ ; split($1,MyArray,"/") ; print MyArray[6] "@" MyArray[5] ; } ; }' >> /usr/src/getAllEmail.txt
sed -i -e 's/*.*//' /usr/src/getAllEmail.txt
sed -i '/^\s*$/d' /usr/src/getAllEmail.txt
Hope this helps someone.
-
Hello :) Thank you for sharing this script. Please note that user-submitted scripts are not tested or supported by cPanel. We encourage everyone to review all aspects of this script before using it on a production server. Thank you. 0
Please sign in to leave a comment.
Comments
1 comment