Exim Command Line Tool - Manage Mail Queue

Master Exim queue management with our comprehensive guide. Learn to list, search, freeze, thaw, and remove messages using Exim commands.

Exim Command Line Tool

Exim Mail Queue Management

The Exim Message Transfer Agent (MTA) is a powerful mail server that requires efficient management of its mail queue. This guide provides essential Exim commands to help administrators monitor, control, and troubleshoot email delivery. Understanding these commands is crucial for maintaining a healthy and responsive mail server.

Core Exim Queue Operations

These commands are fundamental for inspecting the state of your Exim mail queue and understanding message flow.

# Print amount of enqueued messages
exim -bpc

# List messages in the queue (time queued, size, message-id, sender, recipient)
exim -bp

# Print summary of enqueued messages
exim -bp | exiqsumm

# Check what is Exim doing right now
exiwhat

# Display all of Exim's configuration settings
exim -bP

Searching and Filtering the Mail Queue

Efficiently find specific messages within the queue using powerful filtering options.

# Search the queue for messages from a specific sender
exiqgrep -f [user]@domain

# Search the queue for messages from a specific recipient
exiqgrep -r [user]@domain

# Print messages older than the specified number of seconds
# (1 day = 86400 seconds)
exiqgrep -o 86400

# Print messages younger than the specified number of seconds
exiqgrep -y 86400

Controlling Message Delivery and State

Take direct control over individual messages or the entire queue to resolve delivery issues.

# Start a queue run
exim -q -v

# Remove message from the queue
exim -Mrm <message-id> [ <message-id> ... ]

# Freeze message
exim -Mf <message-id> [ <message-id> ... ]

# Thaw (unfreeze) a message
exim -Mt <message-id> [ <message-id> ... ]

# Deliver message, whether it's frozen or not,
# whether the retry time has been reached or not
exim -M <message-id> [ <message-id> ... ]

# Force message to fail and bounce as "canceled by administrator"
exim -Mg <message-id> [ <message-id> ... ]

Inspecting Message Details

Examine the contents and logs of individual messages to diagnose problems.

# View message's headers
exim -Mvh <message-id>

# View message's body
exim -Mvb <message-id>

# View message's logs
exim -Mvl <message-id>

Modifying Message Recipients and Senders

Adjust message metadata, such as recipients and senders, when necessary.

# Add a recipient to a message
exim -Mar <message-id> <address> [ <address> ... ]

# Edit the sender of a message
exim -Mes <message-id> <address>

Further Resources

For more in-depth information on Exim configuration and advanced usage, consult the official Exim documentation and community resources.