5

I'm on a CentOS 7 server that runs sendmail and unfortunately I'm not allowed to install new packages. Postfix tools are not installed; AFAIK the only tool available is mailq, that permits only to see the mailqueue.

Is there a way to operate easily on the mailqueue, apart from grepping or deleting the files /var/spool/mqueue/* by hand?

4

To deal with queues in sendmail you have the qtool.pl utility in the contrib sendmail source code directory. Nowadays in some distributions, qtool.pl is installed together with sendmail.

qtool - manipulate sendmail queues

EXAMPLES

   qtool.pl q2 q1
          Moves all of the queue files in queue q1 to queue q2.

   qtool.pl q2 q1/d6CLQh100847
          Moves the message with id d6CLQh100847 in queue q1 to queue q2.

   qtool.pl q2 q1/qfd6CLQh100847
          Moves the message with id d6CLQh100847 in queue q1 to queue q2.

   qtool.pl -e '$msg{num_delivery_attempts} == 3' /q2 /q1
          Moves  all  of  the  queue  files  that have had three attempted
          deliveries from queue q1 to queue q2.

Please see also:

Sendmail: Clear / Delete / Flush Mail Queue

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.