Script to delete emails based on subject
I would like your input and advice on dealing with some email issues.
We have some 40,000 emails in one of our mailboxes (email@example.com) with a single subject ("Mail delivery failed: returning message to sender")
I would like to delete all of these messages with this subject. I am not able to do this using regular email clients such as outlook or thunderbird (extremely time consuming.)
Is there a way I could do this via command line or a script?
I would appreciate any input and help in this regard.