If you intend to stop using Protonmail, non of this is required however if you just want to clear down unwanted emails and claim back storage quota this may be of use.
According to ProtonMail support in normal operation you need to move emails to the delete folder then go into the delete folder and delete all to get rid of them.
This way youre 'all mail' folder wont just fill up eternally, increasing storage and thus require to buy more storage
Also if youve got a paid plan and wish to delete an associated domain name, you can't do this untill all emails that are addressed to that domain have first been deleted.
So you may find yourself with > 1000 emails in 'all mail' and even though Protomail say you can use an email client like Thunderbird you are stuck with Protmail bridge saying that you are not allowed to remove items from all mail folder
Manually clicking on 'move to trash', clicking on trash to 'delete all' for 50 emails at a time X however many times you need to do this, possibly going into the hundereds is not really a viable option.
Backup any emails you want to keep.
If you have a paid account there is a tool that will run on Windows and Mac that can do this, still currently in beta but it works ok
https://proton.me/blog/import-export-beta
Another way is to install onto Windows, Linux or Mac the bridge service :
Then any imap compliant email client can be used to connect to your ProtonMail account, download locally any emails you want to keep or even upload them elsewhere
Disclaimer - you do this at your own risk and have read the above in order to back up any emails you want to keep !
Navigate to the 'all mail' folder in protonmail in Chrome or a compatible, modern browser and open the console in dev tools
paste the above script
run the script by pasting :
runMain()
Restore any emails you backed up previously if you need to