Question : sendmail : how to stop sending of mails ?

hello experts
I have executed a php script to send emails tyhrough sendmail

when I type in
mailq

I can see scrolling texts such as:

(...)
n7729RQO012880      660 Fri Aug  7 04:09 www.xxxx.net>
                 (Deferred: Connection timed out with hoymail.fr.)
                                         
n77AM672015340      660 Fri Aug  7 12:22 www.xxx.net>
                 (Deferred)
                                         
n772CSBg014688      662 Fri Aug  7 04:12 www.xxxx.net>
                 (Deferred: Connection timed out with ix.alldomains.com.)
                                         
n776mF65017870      660 Fri Aug  7 08:48 www.xxx.net>
(...)
I tried to empty the queue with :
sendmail -q


but when I type mailq again, I can see the scrolling text again

My question is:
HOW TO STOP SENDING of emails ? I tried to reboot my server and restart the sendmail: did not happen.
Thanks a lot

Answer : sendmail : how to stop sending of mails ?

You would

cd /var/spool/mqueue

rm *fn7729RQO012880
rm *fn77AM672015340
rm *fn772CSBg014688
rm *fn776mF65017870
etc.

It is not really necessary to stop sendmail. As soon as the qf... file is deleted, sendmail will stop trying to send the message.

In the general case, you could

cd /var/spool/mqueue
rm `grep -l "Connection timed out" qf* | sed 's/qf/*f/' `

this finds the queue files (the parameter files) of the timed out messages - the qf files, and changes qf to *f, so that the rm will get the qf, df, and, if they exist, the xf and tf files.


Random Solutions  
 
programming4us programming4us