Updating options for update_quota_mail.sh script

This commit is contained in:
Squidly 2014-07-31 15:32:47 +02:00
parent d37d906ff5
commit a456a545b0
1 changed files with 42 additions and 43 deletions

View File

@ -23,7 +23,7 @@ do
if [[ ! "$OPTARG" =~ ^[^\@]*@[^\@]*$ ]] ; then
showhelp "bad mail address provided"
fi
if [[! "$(mysql_query "select userdb_home from dovecot_view where user = '$OPTARG'")" ]]; then
if [[ ! "$(mysql_query "select userdb_home from dovecot_view where user = '$OPTARG'")" ]]; then
showhelp "non existant mail address"
fi
maildirs=$(mysql_query "select userdb_home from dovecot_view where user = '$OPTARG'")
@ -32,7 +32,7 @@ do
# Expecting a domain
# Check if domain is well-formed
if [[ ! "$OPTARG" =~ ^[a-z\-]+(\.[a-z\-]+)+$ ]] ; then
if [[ ! "$OPTARG" =~ ^[a-z0-9\-]+(\.[a-z\-]+)+$ ]] ; then
showhelp "bad domain provided"
fi
@ -46,7 +46,7 @@ do
;;
"c")
# An account
if [[! "$OPTARG" =~ ^[a-z]*$ ]] ; then
if [[! "$OPTARG" =~ ^[a-z0-9]*$ ]] ; then
showhelp "bad account provided"
fi
if [[! "$(mysql_query "select domaine from domaines where domaine = '$1'")" ]]; then
@ -101,4 +101,3 @@ for i in $maildirs ; do
mysql_query "UPDATE mailbox SET messages=$mail_count WHERE path='$i' ; "
done