Most Frequently used Commands in Exim


Most Frequently used Commands in Exim


Managing the Mail queue using 'exim' command



# exim -bpc
  -Print the total number of mail in mail queue.

# exim -bp
  -Print a listing of mails in the queue (time queued, size, message-id, sender, recipient)

# exim -bp | exiqsumm
  -Print a summary of messages in the queue (count, volume, oldest, newest, domain, and totals)

# exiwhat
  -To print what Exim is doing right now
----------------------------------------------------------------------------------------------------------------------------------


# exim -Mvh <message-id>
  -To view a message's headers

# exim -Mvb <message-id>
  -To view a message's body

# exim -Mvl <message-id>
  -To view a message's logs

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

# exim -Mrm <message-id>
  -To remove a message from the queue

# exim -Mf <message-id>
  -To freeze a message

----------------------------------------------------------------------------------------------------------------------------------

# exim -bp | awk '$6~"frozen" { print $3 }' | xargs exim -Mrm
or
# exim -bp | grep frozen | awk '{ print $3 }' | xargs exim -Mrm

  -To remove all frozen mails in the queue

----------------------------------------------------------------------------------------------------------------------------------

To check how exim will route a given address:



# exim -bt alias@localdomain.com
  user@thishost.com
    <-- alias@localdomain.com
  router = localuser, transport = local_delivery

# exim -bt user@localdomain.com
  user@localdomain.com
  router = localuser, transport = local_delivery

# exim -bt user@remotehost.com
  router = lookuphost, transport = remote_smtp
  host mail.remotehost.com [1.2.3.4] MX=0

=================================================================================

Managing the Mail queue using 'exiqgrep' command



Exim includes a utility called exiqgrep, that is very useful for grepping through the queue.

# exiqgrep -f user@domain.com
  -To search the queue for messages from a specific sender

# exiqgrep -r user@domain.com
  -To search the queue for messages for a specific recipient/domain

# exiqgrep -o <sec>
  -To print messages older than the specified number of seconds.

# exiqgrep -y <sec>
  -To print messages that are younger than the specified number of seconds.

# exiqgrep -i
  -To print the message-id of the entire queue

# exiqgrep -c
  -To print a count of messages


----------------------------------------------------------------------------------------------------------------------------------

# exiqgrep -zi | xargs exim -Mrm
# exim -bpr | grep frozen | awk {'print $3'} | xargs exim -Mrm
  -To remove all frozen messages

# exiqgrep -o 86400 -i | xargs exim -Mrm
  -To remove all messages older than 1 day.

# exiqgrep -i -f user@domain.com | xargs exim -Mf
  -To freeze all queued mail from a given sender

# exiqgrep -i -f '<>'  | xargs exim -Mrm
  -To remove all mail delivery failure mails.

# exim -M <MessageID> <MessageID> ...
  - Forcefully send a frozen mail from the queue.

# exiqgrep -z -i | xargs exim -M
  - Forcefully send all the frozen mails in the queue


Reference:-
http://bradthemad.org/tech/notes/exim_cheatsheet.php

This entry was posted in by Arun Ghosh. Bookmark the permalink.