Skip to main content
All CollectionsWebHost Manager (WHM)
Remove frozen emails from mail queue
Remove frozen emails from mail queue

Use Exim to quickly free up a frozen email service

Scott avatar
Written by Scott
Updated over a week ago

Emails can build up for a variety of different reasons but mainly results from emails which were undelivered. 

When an email is sent and undelivered, the Mail Transfer Agent will typically try to deliver it several more times. If still the email remains undelivered after a predefined amount of 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

In the above configuration, timeout_frozen_after is set to 5 days, meaning Exim will mark emails as frozen if they remain undelivered after 5 days.

There are many Exim mail server command-line options available to help manage the email queue. Here, we'll focus on clearing frozen emails.

Please use below commands to remove all frozen emails from the mail queue

# exim -bp|grep frozen|awk '{print $3}' |xargs exim -Mrm
# exiqgrep -z -i | xargs exim -Mrm
# exim -bp | grep "<>" | awk {'print $3'} | xargs exim -Mrm

Please use below commands to remove emails which are in the queue for more than 5 days (432000 seconds)

# exiqgrep -o 432000 -i | xargs exim -Mrm


Congratulations! You've successfully removed the frozen emails from mail queue.

If you have any questions, please don’t hesitate to contact our team via live chat.

For technical inquiries, please feel free to reach our support team by emailing support@bigscoots.com from your registered email or by submitting a support ticket.

Did this answer your question?