#!/bin/bash
# Reset vpopmail email quotes for a whole domain name
# Syntax: [ Accepts one argument the domain name for which the quota has to be reset ]
# Written by hip0 20.02.2012
# http://www.pc-freak.net
# License GPLv3
arg1=$1;
# if vpopmail is in /home/vpopmail instead change with proper location below variable

vpopmail_domains_location=/var/vpopmail/domains;
if [[ $arg1 ]]; then

if [ -d $vpopmail_domains_location/$arg1 ]; then
cd /var/vpopmail/domains/$arg1;
for i in *; do 
/var/vpopmail/bin/vmoduser -q NOQUOTA $(echo $i|grep -v vpasswd)@$arg1; 
done
else 'Incorrect domain name. Please specify a correct one.';
fi

else
echo "Virtual Email domain missing. Please specify vpopmail virtual domain name!";
fi
