Exim commands

Useful exim commands:

exim -M id      #Try to send the message with id id
exim -qf       #Tell exim to process the entire queue again
exim -qff      #same as qf, but it will flush the frozen messages
exim -Mvl id    #view the message log for message id
exim -Mvh id    #view message id‘s headers
exim -Mvb id    #view message id‘s body
exim -Mrm id    #remove message id from the queue
exim -Mg id     #fail and send a bounce to the sender
exim -bp | exiqsumm    #Print summary of the messages in the queue
exiwhat        #show what exim is doing right now
exim -bpc      #show number of messages in the queue
exim -bp       #print list of messages in the queue

exim -bP | grep message_size_limit

exiqgrep -z -i | xargs exim -Mrm // Remove all frozen messages

exiqgrep -i -f [email protected] | xargs exim -Mf // Freeze all queued mail from a given sender

exiqgrep -i -f ‘<[email protected]>’ | xargs exim -Mrm // remove all mails from user [email protected]

exim -bp | grep “[email protected]” | awk ‘{print $3}’ | xargs exim -Mrm


Exim_remove script to clear queue:


Usage: /root/exim_remove [-r] [-sb <PATTERN> | -sh <PATTERN>] [-i] [-f] [-s]

-r: remove the emails from queue not just list info

-sb: search email’s body in the exim queue for PATTERN

-sh: search email’s header in the exim queue for PATTERN

-i: treat PATTERN as case insensitive

-f: search for the frozen emails in the exim queue

-s: generate mail queue stats

The manual way to remove the entire queue is as follows

cd /var/spool
mv exim exim.old
mkdir -p exim/input
mkdir -p exim/msglog
mkdir -p exim/db
chown -R mail:mail exim

Click to rate this post!
[Total: 0 Average: 0]