remote mail support

This commit is contained in:
Serghey Rodin 2014-04-01 23:51:10 +03:00
commit 972ecfaa74
33 changed files with 288 additions and 271 deletions

View file

@ -42,9 +42,21 @@ is_object_unsuspended 'mail' 'DOMAIN' "$domain"
get_domain_values 'mail'
accounts=$(wc -l $USER_DATA/mail/$domain.conf|cut -f 1 -d ' ')
rm -f /etc/$MAIL_SYSTEM/domains/$domain_idn
rm -rf $HOMEDIR/$user/conf/mail/$domain
rm -rf $HOMEDIR/$user/mail/$domain_idn
# Deleting exim configuration files
if [[ "$MAIL_SYSTEM" =~ exim ]]; then
rm -f /etc/$MAIL_SYSTEM/domains/$domain_idn
rm -rf $HOMEDIR/$user/conf/mail/$domain
rm -rf $HOMEDIR/$user/mail/$domain_idn
fi
# Deleting dkim dns record
if [ "$DKIM" = 'yes' ] && [ -e "$USER_DATA/dns/$domain.conf" ]; then
records=$($BIN/v-list-dns-records $user $domain plain)
dkim_records=$(echo "$records" |grep -w '_domainkey' | cut -f 1 -d ' ')
for id in $dkim_records; do
$BIN/v-delete-dns-record $user $domain $id
done
fi
#----------------------------------------------------------#
@ -65,7 +77,6 @@ if [ "$DKIM" = 'yes' ]; then
fi
decrease_user_value "$user" '$U_MAIL_ACCOUNTS' "$accounts"
# Logging
log_history "deleted mail domain $domain"
log_event "$OK" "$EVENT"