Showing results for 
Search instead for 
Did you mean: 


Go to solution
Honored Contributor


Re: /var/spool/mqueue

I've got stuff in here that's really old.

Can I just (for example) :

#cd /var/spool/mqueue
#find . -mtime +45 | xargs rm


If not, why not? What problems does it cause?
We are the people our parents warned us about --Jimmy Buffett
Geoff Wild
Honored Contributor

Re: /var/spool/mqueue


I do this from my linux server:

/usr/bin/find /var/spool/mqueue/ -mtime 1 |xargs rm -f {}; > /tmp/cleanmqueue.cron.log 2>&1

I get a few errors in the maillog - file not found...

You could stop sendmail, do your find, then start sendmail.

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Honored Contributor

Re: /var/spool/mqueue

Thank you Geoff - much appreciated.
We are the people our parents warned us about --Jimmy Buffett
Dennis Handly
Acclaimed Contributor

Re: /var/spool/mqueue

Or you can manually edit those files and correct any bad addresses and send them on. ;-)

The files come in pairs, one is headers and the other is the message.
Steven E. Protter
Exalted Contributor

Re: /var/spool/mqueue


This process as defined will cause no problems.

A complete delete will possibly hammer mail messages in progress, generating error messages in maillog.

Steven E Protter
Owner of ISN Corporation
Sam McKnight
Frequent Advisor

Re: /var/spool/mqueue

Most messages stay in mqueue a very short time unless they can't be delivered. You might examine some of the messages that have been there for a while to determine what they are. If it is nothing you want to keep, delete them.

Last summer, just before I was leaving on vacation, my mail server was subjected to a denial-of-service attack where it was receiving tens of thousands of messages a day. In desperation, I set up a cron process that emptied mqueue every hour. By examining the mail received during the period I was away, it appeared that I lost few,if any, valid incoming messages through the sledge hammer approach.


Honored Contributor

Re: /var/spool/mqueue

Thanks Dennis, Steven & Sam.

I always appreciate the fine expert help.

I just didn't want to start having problems getting current "good" mail out of the server b/c I made the list of mail to be sent go into a "spaz" just b/c I felt like housecleaning...

I've cleaned up and everything is still running smoothly.

Happy New Year!

We are the people our parents warned us about --Jimmy Buffett