Sometimes you just want to clean up a very full imap mailbox programmatically. This Python3 script might help.
Be careful. With great power comes great responsibility.
You have to add a file named credentials.py for this to work. It should look like this:
credentials=dict(user="username",password="password")
... and it should contain your username and password. Then, configure the hostname in imapdel.py
.