diff --git a/src/mail_deletion.sh b/src/mail_deletion.sh index b50b836e..f9caa5bd 100755 --- a/src/mail_deletion.sh +++ b/src/mail_deletion.sh @@ -63,7 +63,7 @@ done # List the adresses to DELETE # Delete if only if there isn't any mailbox refering to it -mysql_query "DELETE FROM a using address a, mailbox m WHERE a.mail_action='DELETE' OR a.mail_action='DELETING' AND a.id != m.address_id;" +mysql_query "DELETE FROM a USING address a, mailbox m WHERE (a.mail_action='DELETE' OR a.mail_action='DELETING') AND a.id != m.address_id;" # Delete the lock rm -f "$LOCK_FILE"