From 1018028f31d5798b5bbc55b87baf1d0364fca1c0 Mon Sep 17 00:00:00 2001 From: Matthew Saunders Brown Date: Mon, 15 Feb 2021 16:58:40 -0800 Subject: [PATCH] removed extra queries --- bin/vmail-mboxes-del.sh | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/bin/vmail-mboxes-del.sh b/bin/vmail-mboxes-del.sh index 2907a68..a273467 100755 --- a/bin/vmail-mboxes-del.sh +++ b/bin/vmail-mboxes-del.sh @@ -71,19 +71,11 @@ if [ -z "$mboxes_id" ]; then exit 1 elif [ "$mboxes_id" -gt '0' ]; then if [ -n "$force" ] || vmail::yesno "Delete $email now?"; then - # once ON DELETE CASCADE is set only this first query is needed for vm_* tables + # this should be sufficient for vm_* tables due to ON DELETE CASCADE foreign key references dbquery="DELETE FROM vm_mboxes WHERE vm_mboxes.id='$mboxes_id'" echo $dbcmd $dbcmdopts "\"$dbquery\"" dbquery="DELETE FROM sa_userpref WHERE username='$email'" echo $dbcmd $dbcmdopts "\"$dbquery\"" - dbquery="DELETE FROM vm_aliases WHERE mbox_id='$mboxes_id'" - echo $dbcmd $dbcmdopts "\"$dbquery\"" - dbquery="DELETE FROM vm_autoresponders WHERE mbox_id='$mboxes_id'" - echo $dbcmd $dbcmdopts "\"$dbquery\"" - dbquery="DELETE FROM vm_filters WHERE mbox_id='$mboxes_id'" - echo $dbcmd $dbcmdopts "\"$dbquery\"" - dbquery="DELETE FROM vm_forwards WHERE mbox_id='$mboxes_id'" - echo $dbcmd $dbcmdopts "\"$dbquery\"" dbquery="DELETE FROM vm_greylisting WHERE recipient='$email'" echo $dbcmd $dbcmdopts "\"$dbquery\"" dbquery="DELETE FROM vm_greylisting WHERE recipient LIKE '$mbox+%@$domain'"