Some useful Exim Commands

Print a count of the messages in the queue:
exim -bpc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print a listing of the messages in the queue (time queued, size, message-id, sender, recipient):
exim -bp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print a summary of messages in the queue (count, volume, oldest, newest, domain, and totals):
exim -bp | exiqsumm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
display Exim stats from a logfile:
eximstats /path/to/exim_mainlog
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
display Exim stats from a logfile, with less verbose output:
eximstats -ne -nr -nt /path/to/exim_mainlog
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Generate and display Exim stats from a logfile, for one particular day:
fgrep 2007-02-16 /path/to/exim_mainlog | eximstats
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print what Exim is doing right now:
exiwhat
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To delete frozen emails
exim -bp | awk ‘$6~”frozen” { print $3 }’ | xargs exim -Mrm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To deliver emails forcefully
exim -qff -v -C /etc/exim.conf &
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To delete nobody mails
exim -bp | grep nobody | awk ‘{print $3}’ | xargs exim -Mrm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Searching the queue
Exim includes a utility that is quite nice for grepping through the queue, called exiqgrep. Learn it. Know it. Live it. If you’re not using this, and if you’re not familiar with the various flags it uses, you’re probably doing things the hard way, like piping `exim -bp` into awk, grep, cut, or `wc -l`.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Search the queue for messages from a specific sender:
exiqgrep -f [luser]@domain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Search the queue for messages for a specific recipient/domain:
exiqgrep -r [luser]@domain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print just the message-id as a result of one of the above two searches:
exiqgrep -i [ -r | -f ] …
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print a count of messages matching one of the above searches:
exiqgrep -c [ -r | -f ] …
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print just the message-id of the entire queue:
exiqgrep -i
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Managing the queue, 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 [ … ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Freeze a message:
exim -Mf [ … ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thaw a message:
exim -Mt [ … ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Deliver a specific message:
exim -M [ … ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Force a message to fail and bounce:
exim -Mg [ … ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove all frozen messages:
exiqgrep -z -i | xargs exim -Mrm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove all messages older than five days (86400 * 5 = 432000 seconds):
exiqgrep -o 1296000 -i | xargs exim -Mrm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Freeze all queued mail from a given sender:
exiqgrep -i -f luser@example.tld | xargs exim -Mf
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View a message’s headers:
exim -Mvh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View a message’s body:
exim -Mvb
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View a message’s logs:
exim -Mvl
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s