Below are useful command that we can use to list all User’s Email Addresses under a Reseller in Direct Admin.
Usually we want to do this when there are Maintenance need to be done in Shared Hosting and we would like to let all customer know by blasting emails for them.
Let say, we have a reseller named “Support” and we would like to list all email addresses for the users under the Reseller.
Command :
for i in `cat /usr/local/directadmin/data/users/support/users.list`; do cat /usr/local/directadmin/data/users/$i/user.conf | grep 'email=' | awk -F '=' {'print $2'}; done
Example Output :
[root@ns24 ~]# for i in `cat /usr/local/directadmin/data/users/support/users.list`; do cat /usr/local/directadmin/data/users/$i/user.conf | grep 'email=' | awk -F '=' {'print $2'}; done
tfawyong@ip.my
juniorelnino@gmail.com
support@ipserverone.com
doormart@gmail.com
ricky@edasu.com
thchai@ipserverone.com
saohao@isatech.com.sg
ksmak@ipserverone.com
aaron@hulk.my
aaron@hulksolutions.com
account@mdgsb.com,olive.chong@mdgsb.com
mlol@mlol.co.cc
ahmadadham@gmx.com,myccr.trading@gmail.com
Now you may proceed to use the email listed to blast the Maintenance notice 🙂