Clearing postfix mail queue by domain
Linux, Postfix, Servers, Slider September 9, 2014 , by Mark Walker No Comments on Clearing postfix mail queue by domainRecently my phone started frantically beeping with the mail servers hard drive filling up and CPU load through the roof.
After eventually managing to login, stopping postfix the CPU came under control.
20 mins of waiting for the queue to open up and it shows 30,000 pending emails – ahhhhh!
28,500 of those were from a single domain, it appears 4 accounts from one of our clients have moved to Eastern Europe and gone on an email spree.
Webmin wouldn't be up to the task of clearing these so I needed a shell command that could clear everything by domain name.
The solution that did the job is below.
postqueue -p | tail -n +2 | awk 'BEGIN { RS = "" } / *@example\.com/ { print $1 }' | tr -d '*!' | postsuper -d –
Founder at Awcode
Mark Walker is a web developer, system administrator and entrepreneur, born in England but calling Thailand home for over a decade.
Latest posts by Mark Walker (see all)
- The Quintessence of Cybersecurity and Stellar IT Support - November 9, 2023
- Choosing the Right Payment Processor for Your Website - March 3, 2022
- Choosing a business management system - June 11, 2020
Related Articles
-
-
A Brief Analysis Of The Best Linux Operating Systems
December 19, 2014
-
Fantastic Web Design Tips That Will Help Improve Your Site
December 15, 2014 -
Top Trends Dominating The World Of SEO
December 10, 2014
-
Why Does Everybody Love Docker?
November 28, 2014
Latest Reports
-
1 Upgrading to WordPress 4.5
May 5, 2016 -
2 WordPress Plugins
January 26, 2016 -
3 What Are CMS Platforms And How Do You Choose The Right One?
November 19, 2014 -
4 How To Create A Successful Website On A Budget
November 18, 2014
-
1 Choosing the Right Payment Processor for Your Website
March 3, 2022 -
2 How To Write An Excellent Product Review
December 26, 2014 -
3 Fantastic Web Design Tips That Will Help Improve Your Site
December 15, 2014 -
4 Tips You Need To Know About Web Hosting
November 26, 2014 -
5 The Biggest Websites In The World Today
November 23, 2014
-
1 Fantastic Web Design Tips That Will Help Improve Your Site
December 15, 2014 -
2 A Review Of 3 Web Design Software Packages For Beginners
December 5, 2014 -
3 Four Fantastic Tips For Web Development
November 24, 2014 -
4 What Are CMS Platforms And How Do You Choose The Right One?
November 19, 2014 -
5 How To Create A Successful Website On A Budget
November 18, 2014
-
1 Why Does Everybody Love Docker?
November 28, 2014 -
2 Tips You Need To Know About Web Hosting
November 26, 2014 -
3 Clearing postfix mail queue by domain
September 9, 2014 -
4 Linux disk full errors but disk has space
September 9, 2014
Leave a comment
You must be logged in to post a comment.