cancel
Showing results for 
Search instead for 
Did you mean: 

/var/spool/mqueue

SOLVED
Go to solution
TwoProc
Honored Contributor

/var/spool/mqueue

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
6 REPLIES
Geoff Wild
Honored Contributor
Solution

Re: /var/spool/mqueue

Sure!

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.

Rgds...Geoff
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.
TwoProc
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

Shalom,

This process as defined will cause no problems.

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

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
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.

Regards,

Sam
TwoProc
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!

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