Archive for Exim

Exim useful commands

Exim is a very common MTA ( Mail Transfer Agent) used worldwide. There are so many inbuilt exim commands which are helpful for the admins to take care of the mail issues. Below I am pasting some useful commands which I have been using.

Number of mails in the queue

# exim -bpc
 Details of the messages in the queue (time queued, size, message-id, sender, recipient)
# exim -bp
Summary of messages in the queue (count, volume, oldest, newest, domain, and totals)
# exim -bp | exiqsumm
See what exim is doing currently
# exiwhat
Exim's configuration settings
# exim -bP
Exiqgrep
Search the queue for messages from a specific sender
# exiqgrep -f user@domain
Search the queue for messages for a specific recipient/domain
# exiqgrep -r user@domain

List the message older than specified number of seconds

# exiqgrep -o 3600
List the messages that are younger than the specified number of seconds
# exiqgrep -y 3600
Queue management
Start a queue run
# exim -q -v
Start a queue run for just local deliveries
# exim -ql -v
Remove a message from the queue
# exim -Mrm <message-id>
Freeze a message
# exim -Mf <message-id>
Thaw a message
# exim -Mt <message-id>
Deliver a message, whether it's frozen or not, whether the retry time has been reached or not
# exim -M <message-id>
Deliver a message, but only if the retry time has been reached
# exim -Mc <message-id>
Remove all frozen messages
# exiqgrep -z -i | xargs exim -Mrm
Remove all messages older than specified seconds(eg:5days)
# exiqgrep -o 432000 -i | xargs exim -Mrm
Freeze all queued mail from a given sender
# exiqgrep -i -f user@example.com | xargs exim -Mf
View a message's headers
# exim -Mvh message-id
View a message's body
# exim -Mvb <message-id>
View a message's logs
# exim -Mvl <message-id>
Add a recipient to a message
# exim -Mar <message-id> mail@domain
Edit the sender of a message
#exim -Mes <message-id> mail@domain