Had an issue several hours ago with a client mail account, which got compromised. As a result, he had hundreds of thousands of spam queued in postfix, which lead to several issues. Everything's fixed and security's tied up, apart from one "small" issue: the client now has close to 100k of returned spam mails in his inbox. And obviously, I'm looking for a bulk operation with some filtering as everything's not junk. PF runs on Ubuntu server v10.x, with maildir.
I tried this command on a backed-up folder containing the same files:
grep -l -r 'Undelivered' | xargs rm
But it doesn't seem to do anything apart from running.
Can this come from the fact that all the "mails" are stored inside files named this way: