Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I want to know the command that will flush the queue for sendmail?
I type /usr/sbin/sendmail -bp and I get a list of the queue. I don't want any of the messages in this queue to go out, so I need to delete them. What is the command to flush out the existing queue?
I use a brute force method of
echo "" > /var/spool/mqueue
this can happen quickly - however since I don't get a lot of traffic I don't stop sendmail first - if you do have traffic then it is recommended that you stop/restart sendmail
Originally posted by glock19 I want to know the command that will flush the queue for sendmail?
I type /usr/sbin/sendmail -bp and I get a list of the queue. I don't want any of the messages in this queue to go out, so I need to delete them. What is the command to flush out the existing queue?
I have around 1000 mails queued up in Nagios /var/spool/mqueue.
I don't want to miss out on any mails.
Is there a way I can push these mails out instead of rm -rf * ? ?
#!/bin/sh
for QF in `ls qf*`
do
blacklisted=`grep "could not send" $QF`
if [ "$blacklisted" = "" ]
then
# trying to resend GOOD letter:
echo `sendmail -v -qI$QF -d11`
else
# permanently deleting BAD letter:
body=`echo $QF | sed 's/qf/df/'`
rm $body
rm $QF
fi
done
"could not send" - change to any "unwanted text in e-mail".
N.B.
df_LETTER_ID - body of the letter
qf_LETTER_ID - header of the letter
Last edited by NetSpiderUA; 11-18-2010 at 11:40 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.