I’m trying to clear the exim mail queue using my php script on CentOS v7.9. I can easily get the mail queue count by issuing the following php command without any problems:
echo *root password* | sudo -S /usr/sbin/exim -bpc
However, when i try to clear the mail queue using the following command, i get “no message id given after -Mrm option”:
echo *root password* | sudo -S /usr/sbin/exiqgrep/exiqgrep -z -i | xargs /usr/sbin/exim -Mrm 2>&1
Even when I try to execute the following command i get the same error message “no message id given after -Mrm option”:
echo *root password* | sudo -S /usr/sbin/exim -bp|grep "<"|awk {'print $3'}|xargs /usr/sbin/exim -Mrm 2>&1
Any help will be appreciated