1836786 Members
2627 Online
110110 Solutions
New Discussion

Re: clearing out mailq

 
SOLVED
Go to solution
someone_4
Honored Contributor

clearing out mailq

Hey everyone ..
I know there is a way to force the mail in the mailq to go out in sendmail. And to clean out the mailq.The seach on the forum is not up and I know there was a post about this but I cant find it. Can someone please give me the commands on how to do that.

Richard
11 REPLIES 11
Uday_S_Ankolekar
Honored Contributor
Solution

Re: clearing out mailq

Hi,

sendmail -bd -q0 should work.

-USA...
Good Luck..
James R. Ferguson
Acclaimed Contributor

Re: clearing out mailq

Dear Richard:

You're slipping. You asked additional questions in an earlier post, but have neglected to look at and score the detailed responses:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,11866,0x01fbc6af36b7d5118ff10090279cd0f9,00.html

...JRF...
Sridhar Bhaskarla
Honored Contributor

Re: clearing out mailq

Stop the sendmail /sbin/init.d/sendmail stop

Run it in foreground with q 0

sendmail -bD -q 0

It should clear the queue.

-Sri

You may be disappointed if you fail, but you are doomed if you don't try
someone_4
Honored Contributor

Re: clearing out mailq

 
someone_4
Honored Contributor

Re: clearing out mailq

how about that .. are kernal parms are at default .. so I am going to have to up nfile and reboot.
Sridhar Bhaskarla
Honored Contributor

Re: clearing out mailq

Richard,

Ooops.. your nfile limit is reached. This could be because of your sendmail queue. See why you have got such a queue?.Is there is anything wrong that the mail is queued up?.

Stop sendmail through /sbin/init.d and kill all the sendmail processes.They will release enough files. Move /var/spool/mqueue to /var/spool/mqueue.old and create another fresh directory /var/spool/mqueue with the same permissions. Start sendmail and let it go.

ONce you are stabilized, check up the mails in mqueue.old and see why there were being queued up. Schedule sometime to send these messages by copying them back to mqueue directory.

It's not a bad idea to increase your nfile value if this often a case with your system.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sridhar Bhaskarla
Honored Contributor

Re: clearing out mailq

Also...

try it with -D option this will run sendmail in foreground and will attempt to deliver the messages sequentially without causing nfile problem.

running sendmail in background (-d) will spawn multiple sendmail processes and will subsequently open a number of files depending on the messages in /var/spoool/mqueue.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
someone_4
Honored Contributor

Re: clearing out mailq

Ok I am back up now .. good good .. =)
Now skindar what would remaking a mqueue dir do for me? I do see I have allot of 0 files in there and that would be why I have (no control files). But I am going to delete them.

Richard
Sridhar Bhaskarla
Honored Contributor

Re: clearing out mailq

You might have had too many messages in your /var/spool/mqueue. Sendmail will attempt to deliver each message by opening it. Stopping sendmail and moving this directory will temporarly halt sendmail activity on these messages. By creating an empty directory and starting the sendmail will re-enable mail activity but only for the new messages. You can check the old messages in /var/spool/mqueue.old later and you can move the genuine messages back into mqueue directory when they will be processed by sendmail. You might have hindered around with few messages. But I suppose it should be ok when compared to the entire system down with nfile problem.

Also, if it is a very common problem, try to increase nfile parameter to a better value.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
someone_4
Honored Contributor

Re: clearing out mailq

we got infile at 4000 ..
and the mqueue is lookin good
mailq is looking .. its friday 6pm and im fixxing to look at some Crown and coke .. =)
rprock
New Member

Re: clearing out mailq

I think most danced around saying this..
to clean it immediately:
sendmail -q
to have sendmail continuously running(in 15 minute intervals):
sendmail -bd -q15m
one should not increase, beyond what is necessary, the number of entities required to explain anything