Removing single mail from queue:
exim -Mrm MESSAGE-ID
How to remove all emails from the Exim mail queue?
Yes, that’s what we are discussing. We can do this in different ways. The important things are, we required the email ID and the command “exim -Mrm” to remove email from the mail queue.
Method I: Using ‘exim -bp‘
exim -bp|grep "<"|awk {'print $3'}|xargs exim -Mrm
In this method, the command ‘exim -bp’ is used to find-out the message ID from the Exim mail queue and then remove corresponding email from the mail queue by using the command ‘exim -Mrm’ as argument.
Method II: Using ‘exiqgrep‘
exiqgrep -i|xargs exim -Mrm
The exiqgrep command with ‘-i’ switch list the message ID from mail queue, then remove the mail by using the mail ID.
Method III:
exim -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | bash
That’s it!!
exim -Mrm MESSAGE-ID
How to remove all emails from the Exim mail queue?
Yes, that’s what we are discussing. We can do this in different ways. The important things are, we required the email ID and the command “exim -Mrm” to remove email from the mail queue.
Method I: Using ‘exim -bp‘
exim -bp|grep "<"|awk {'print $3'}|xargs exim -Mrm
In this method, the command ‘exim -bp’ is used to find-out the message ID from the Exim mail queue and then remove corresponding email from the mail queue by using the command ‘exim -Mrm’ as argument.
Method II: Using ‘exiqgrep‘
exiqgrep -i|xargs exim -Mrm
The exiqgrep command with ‘-i’ switch list the message ID from mail queue, then remove the mail by using the mail ID.
Method III:
exim -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | bash
That’s it!!
Comment