I need help to find the right command to delete all mail in a specific user's inbox coming from specific domains (spam mail from @qq.com or @sohu.com"...)
Here's how I'd do :
cd to the user's mailbox
Look visually for all the mail coming from qq.com
grep --color=always "^From:.*qq.com" -r .
Adjust the grep filter if there are non qq mail included in the results until you only have mail from qq.com, then
for email in $(grep --color=no "^From:.*qq.com" -l -r .); do echo $email --; rm -rf $email; done;
This will delete all the e-mails for a specific maildir.
You can of course apply to all mailboxes, but it's dangereous.