Notification sounds AFTER a rule (IMAP)

I have some spam rules which delete the email (IMAP) but every 5 minutes I hear a sound but there is no mail, cause it’s deleted. This is confusing.
So technically:

  1. look for new mails
  2. use the rules
  3. Play sound if there is a new email in the Inbox.