|
@@ -32,7 +32,6 @@ check_args '3' "$#" 'user domain email'
|
|
|
|
|
|
|
|
# Checking argument format
|
|
# Checking argument format
|
|
|
format_validation 'user' 'domain' 'email'
|
|
format_validation 'user' 'domain' 'email'
|
|
|
-exit
|
|
|
|
|
|
|
|
|
|
# Checking dns system is enabled
|
|
# Checking dns system is enabled
|
|
|
is_system_enabled 'MAIL_SYSTEM'
|
|
is_system_enabled 'MAIL_SYSTEM'
|
|
@@ -50,27 +49,27 @@ is_domain_valid 'mail'
|
|
|
is_domain_suspended 'mail'
|
|
is_domain_suspended 'mail'
|
|
|
|
|
|
|
|
# Checking errorlog is not added
|
|
# Checking errorlog is not added
|
|
|
-is_domain_key_empty 'mail' '$ANTIVIRUS'
|
|
|
|
|
|
|
+is_domain_key_empty 'mail' '$CATCHALL'
|
|
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
#----------------------------------------------------------#
|
|
|
# Action #
|
|
# Action #
|
|
|
#----------------------------------------------------------#
|
|
#----------------------------------------------------------#
|
|
|
|
|
|
|
|
-# Adding antispam key to config
|
|
|
|
|
-if [ -z "$(grep 'virus' $V_HOME/$user/conf/mail/$domain/protection)" ]; then
|
|
|
|
|
- echo 'antivirus' >> $V_HOME/$user/conf/mail/$domain/protection
|
|
|
|
|
-fi
|
|
|
|
|
|
|
+# Adding catchall alias
|
|
|
|
|
+sed -i "/*@demo.vestacp.com:/d" $V_HOME/$user/conf/mail/$domain/aliases
|
|
|
|
|
+echo "*@demo.vestacp.com:$email" >> $V_HOME/$user/conf/mail/$domain/aliases
|
|
|
|
|
+
|
|
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
#----------------------------------------------------------#
|
|
|
# Vesta #
|
|
# Vesta #
|
|
|
#----------------------------------------------------------#
|
|
#----------------------------------------------------------#
|
|
|
|
|
|
|
|
# Adding antispam in config
|
|
# Adding antispam in config
|
|
|
-update_domain_value 'mail' '$ANTIVIRUS' 'yes'
|
|
|
|
|
|
|
+update_domain_value 'mail' '$CATCHALL' "$email"
|
|
|
|
|
|
|
|
# Logging
|
|
# Logging
|
|
|
-log_history "$V_EVENT" "v_delete_mail_domain_antivirus $user $domain"
|
|
|
|
|
|
|
+log_history "$V_EVENT" "v_delete_mail_domain_catchall $user $domain"
|
|
|
log_event 'system' "$V_EVENT"
|
|
log_event 'system' "$V_EVENT"
|
|
|
|
|
|
|
|
exit
|
|
exit
|