# get aliases id which also works to confirm alias exists
dbquery="SELECT vm_forwards.id FROM vm_forwards, vm_mboxes, vm_domains WHERE vm_forwards.mbox_id=vm_mboxes.id AND vm_mboxes.mbox='$mbox' AND vm_mboxes.domain_id=vm_domains.id AND vm_domains.domain='$domain';"
vm_forwards_id=`$dbcmd$dbcmdopts"$dbquery"`
if[ -z "$vm_forwards_id"];then
echo"ERROR: Forward for $email does not exist."
exit1
elif["$vm_forwards_id" -gt '0'];then
dbquery="DELETE FROM vm_forwards WHERE vm_forwards.id='$vm_forwards_id';"
eval$dbcmd$dbcmdopts\"$dbquery\"
echo"SUCCESS: Forward for $email removed from system."