Troubleshooting Delivery Issues

Managing Exim Mail Queue: Comprehensive Guide

Published · Updated 3 min read
Knowledge base article
Contents (10 sections)

Introduction

Efficiently managing the Exim mail queue is crucial for maintaining the health, performance, and deliverability of your mail server. The Exim mail queue temporarily stores messages before they reach their destination. Mastering Exim queue management allows for effective troubleshooting and ensures smooth email operations.


Introduction to Exim Mail Queue

Exim is a powerful Mail Transfer Agent (MTA) used on Unix-like systems for handling email routing, delivery, and reception. Messages stored in the Exim mail queue can be monitored, modified, or removed to optimize server performance.

Key Exim Queue Management Operations:

  • Monitor queued emails

  • Remove stuck or frozen emails

  • Force delivery of pending messages

  • Filter and troubleshoot mail queue issues


Basic Exim Queue Commands

List All Messages in the Queue

To list all queued emails:

code
exim -bp

Displays a summary of queued messages.

Remove Messages from the Queue

Remove All Messages Older Than a Specific Time (e.g., 1200 seconds):

code
exiqgrep -o 1200 -i | xargs exim -Mrm

Remove Messages from a Specific Sender:

code
exiqgrep -f [email protected] -i | xargs exim -Mrm

Remove Messages to a Specific Recipient:

code
exiqgrep -r [email protected] -i | xargs exim -Mrm

Remove All Messages in the Queue:

code
exim -bp | exiqgrep -i | xargs exim -Mrm

Remove Frozen Messages (Undeliverable Emails):

code
exiqgrep -z -i | xargs exim -Mrm

Remove Messages Older Than a Specific Time with a Specific Error Status:

code
exiqgrep -i -o 86400 -f '<>' | xargs exim -Mrm

Viewing & Inspecting Emails in the Queue

List Only the Message IDs in the Queue:

code
exim -bp | exiqgrep -i

View the Headers of a Specific Message:

code
exim -Mvh <message-id>

View the Body of a Specific Message:

code
exim -Mvb <message-id>

Freezing & Thawing Messages

Freeze a Specific Message:

code
exim -Mf <message-id>

Thaw (Unfreeze) a Specific Frozen Message:

code
exim -Mt <message-id>

Forcing Message Delivery

Force a Specific Message to Be Delivered:

code
exim -M <message-id>

Force Delivery & Remove the Message Afterward:

code
exim -Mrm <message-id>

Queue Summary & Statistics

List the Number of Messages in the Queue:

code
exim -bpc

Print a Detailed Summary of Messages in the Queue:

code
exim -bp | exiqsumm

Alternative Method to Remove All Messages in the Queue:

code
exim -bpru | awk '{print $3}' | xargs exim -Mrm

Conclusion

Proper Exim queue management is essential for maintaining a healthy, optimized, and secure mail server. By mastering these Exim commands, you can efficiently monitor, filter, and remove problematic emails, ensuring uninterrupted email operations.

Stay ahead in email administration! By applying these techniques, you can prevent email delays, fix queue congestion, and optimize your mail server performance.

Related Guides:

Need Additional Help Contact Domain India Support! https://www.domainindia.com/support

Was this article helpful?

Your answer helps us decide what to improve next.

Still need help? Open a support ticket and our team will reply.

Prefer an app? Add this site to your home screen.Get the app
Managing Exim Mail Queue: Comprehensive Guide - Knowledge Base