The IMAP server is external, I just get the mail from there. But it looks like I got it to work now, maybe the PC restart also helped. Now ESET moves the virus e-mails correctly to the infected folder. Very good, Kaspersky cannot do this.
What confused me in addition is the fact that it looks like Outlook does not support IMAP IDLE (IMAP push) on Windows but this is supported on Mac). This means no immediate notifications when new mail arrives... So only if the Inbox folder is selected (which is not the case if I am working with my Exchange account at the same time) only then Outlook receives new mail. A small workaround is setting the poll interval to 1 minute:
https://www.msoutlook.info/question/check-for-new-email-frequency
It is still not optimal, but it seems to be a stupid Microsoft issue.