Removing frozen emails from mail queue

Frozen emails are the emails sent to invalid, non existing email accounts that were undelivered to the address correctly.

If the email can’t be delivered to an account, the email will be added in the queue and Exim will try a couple of times to deliver the email as per the settings in the RETRY CONFIGURATION in Exim conf file.If the email didn’t deliver to the recipient after the predefined days in Exim conf (timeout_frozen_after), those emails will be marked as frozen.

# grep timeout_frozen_after /etc/exim.conf
timeout_frozen_after = 5d

How to remove all frozen emails from the mail queue?

We can remove the frozen mails by executing different combinations of Exim commands.

Method I

By using ‘exim -bp‘ command

# exim -bp|grep frozen|awk '{print $3}' |xargs exim -Mrm

Method II

By using ‘exiqgrep‘ command

# exiqgrep -iz|xargs exim -Mrm

That’s it 🙂

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Social media & sharing icons powered by UltimatelySocial