Skip to content

Commit c5746be

Browse files
committed
updated mail counters
1 parent 2c237a8 commit c5746be

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

bin/v_delete_mail_account

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ rm -rf $HOMEDIR/$user/mail/$domain/$account
5757
# Update config
5858
sed -i "/ACCOUNT='$account'/d" $USER_DATA/mail/$domain.conf
5959

60+
# Decrease mail accounts counter
61+
accounts=$(wc -l $USER_DATA/mail/$domain.conf | cut -f 1 -d ' ')
62+
decrease_user_value "$user" '$U_MAIL_ACCOUNTS'
63+
update_object_value 'mail' 'DOMAIN' "$domain" '$ACCOUNTS' "$accounts"
64+
6065

6166
# Logging
6267
log_history "$EVENT"

bin/v_suspend_mail_domain

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ rm -f /etc/exim/domains/$domain
4848

4949
# Updating config
5050
update_object_value 'mail' 'DOMAIN' "$domain" '$SUSPENDED' 'yes'
51+
sed -i "s/SUSPENDED='no'/SUSPENDED='yes'/g" $USER_DATA/mail/$domain.conf
5152

5253
# Logging
5354
log_event "$OK" "$EVENT"

bin/v_unsuspend_mail_domain

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ ln -s $HOMEDIR/$user/conf/mail/$domain /etc/exim/domains/
4747

4848
# Updating config
4949
update_object_value 'mail' 'DOMAIN' "$domain" '$SUSPENDED' 'no'
50+
sed -i "s/SUSPENDED='yes'/SUSPENDED='no'/g" $USER_DATA/mail/$domain.conf
51+
5052

5153
# Logging
5254
log_event "$OK" "$EVENT"

0 commit comments

Comments
 (0)