My mail queue has grown to over 70000 emails. Is there any way I can do a filtered delete to get rid of outgoing emails from the MAILER-DAEMON@ without losing any potentially valuable emails?
migration rejected from stackoverflow.com Dec 31 '13 at 8:56
This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.
closed as off-topic by Rex, Dennis Kaarsemaker, MadHatter, Falcon Momot, Ward Dec 31 '13 at 8:56
This question appears to be off-topic. The users who voted to close gave this specific reason:
you didn't mention which email server you use, assuming you use postfix
grep MAILER-DAEMON q.txt | sed 's/ .*//' | sed 's/^/postsuper -h /' > md.sh
if you want you can put everything into one line, but if you have a lot of mails in your queue, this will take some time and putting the list into a file first saves you running the command again if something goes wrong.
with postsuper -h you will put the mails into a hold queue so you will not loose them either, you can delete the mails later.