When delete all emails from a folder , why not just cat its file to trash , delete the file/database and touch the file to create a clean one. that would be 1 second . Deleting all files from a folder is super slow , like 2min for 1000 emails ?? no idea why.
is it calling antivirus each time an email is moved? recent years, deleting messages is painfully slow