File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -621,11 +621,25 @@ is_mail_domain_new() {
621621 if [ " $2 " == ' mail' ]; then
622622 check_result $E_EXISTS " Mail domain $1 exists"
623623 fi
624- mail_user=$( echo " $mail " | cut -f 7 -d /)
624+ mail_user=$( echo " $mail " | cut -f 7 -d /)
625625 if [ " $mail_user " != " $user " ]; then
626626 check_result $E_EXISTS " Mail domain $1 exists"
627627 fi
628628 fi
629+ mail_sub=$( echo " $1 " | cut -f 1 -d .)
630+ mail_nosub=$( echo " $1 " | cut -f 1 -d . --complement)
631+ for mail_reserved in $( echo " mail $WEBMAIL_ALIAS " ) ; do
632+ if [ ! -z " $( ls $HESTIA /data/users/* /mail/$mail_reserved .$1 .conf 2> /dev/null) " ]; then
633+ if [ " $2 " == ' mail' ]; then
634+ check_result $E_EXISTS " Required subdomain \" $mail_reserved .$1 \" already exists"
635+ fi
636+ fi
637+ if [ ! -z " $( ls $HESTIA /data/users/* /mail/$mail_nosub .conf 2> /dev/null) " ] && [ " $mail_sub " = " $mail_reserved " ]; then
638+ if [ " $2 " == ' mail' ]; then
639+ check_result $E_INVALID " The subdomain \" $mail_sub .\" is reserved by \" $mail_nosub \" "
640+ fi
641+ fi
642+ done
629643}
630644
631645# Checking mail account existance
@@ -641,7 +655,6 @@ is_mail_new() {
641655 fi
642656}
643657
644-
645658# Add mail server SSL configuration
646659add_mail_ssl_config () {
647660 # Ensure that SSL certificate directories exists
You can’t perform that action at this time.
0 commit comments