User Tools

Site Tools


scripts:zimbra:generate-alias-list.sh
generate-alias-list.sh
#!/bin/bash
# Written by Thomas York
# Prints out all aliases
 
# Get list of accounts from the server and iterate through it
for GADLOUTPUT in $(sudo -E -u zimbra /opt/zimbra/bin/zmprov -l gaa | sort); do
	# Look up the account and see if it is an alias..
	for GDLOUTPUT in $(sudo -E -u zimbra /opt/zimbra/bin/zmprov ga $GADLOUTPUT | grep zimbraMailAlias | awk '{print $2}'); do
		echo "$GDLOUTPUT -> $GADLOUTPUT";
	done
done
/usr/local/www/vhost/www.fuhell.com/data/pages/scripts/zimbra/generate-alias-list.sh.txt · Last modified: 2014/09/01 15:00 (external edit)