replaced underscore with dash in api syscalls

This commit is contained in:
Serghey Rodin 2012-11-09 18:26:32 +02:00
commit b6b7eacadb
283 changed files with 438 additions and 412 deletions

60
bin/v-add-mail-domain-catchall Executable file
View file

@ -0,0 +1,60 @@
#!/bin/bash
# info: add mail domain catchall account
# options: user domain email
#
# The function enables catchall account for incomming emails.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$(echo $domain | tr '[:upper:]' '[:lower:]')
domain_idn=$(idn -t --quiet -a "$domain")
email="$3"
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
source $VESTA/func/domain.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '3' "$#" 'user domain email'
validate_format 'user' 'domain' 'email'
is_system_enabled "$MAIL_SYSTEM"
is_object_valid 'user' 'USER' "$user"
is_object_unsuspended 'user' 'USER' "$user"
is_object_valid 'mail' 'DOMAIN' "$domain"
is_object_unsuspended 'mail' 'DOMAIN' "$domain"
is_object_value_empty 'mail' 'DOMAIN' "$domain" '$CATCHALL'
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Adding catchall alias
sed -i "/*@$domain:/d" $HOMEDIR/$user/conf/mail/$domain/aliases
echo "*@$domain:$email" >> $HOMEDIR/$user/conf/mail/$domain/aliases
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Adding antispam in config
update_object_value 'mail' 'DOMAIN' "$domain" '$CATCHALL' "$email"
# Logging
log_history "added $email as catchall email for $domain"
log_event "$OK" "$EVENT"
exit