| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #!/bin/bash
- # info: delete mail domains
- # options: USER
- #
- # The function for deleting all users mail domains.
- #----------------------------------------------------------#
- # Variable&Function #
- #----------------------------------------------------------#
- # Argument definition
- user=$1
- # Includes
- source $VESTA/func/main.sh
- source $VESTA/conf/vesta.conf
- #----------------------------------------------------------#
- # Verifications #
- #----------------------------------------------------------#
- check_args '1' "$#" 'USER'
- is_format_valid 'user'
- is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
- is_object_valid 'user' 'USER' "$user"
- #----------------------------------------------------------#
- # Action #
- #----------------------------------------------------------#
- # Starting delete loop
- for domain in $(search_objects 'mail' 'SUSPENDED' "no" 'DOMAIN'); do
- $BIN/v-delete-mail-domain "$user" "$domain"
- done
- #----------------------------------------------------------#
- # Vesta #
- #----------------------------------------------------------#
- # Logging
- log_event "$OK" "$ARGUMENTS"
- exit
|