Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
mail:exim-management [2010-10-14 22:39:05]
shaun.reitan Approved
mail:exim-management [2016-03-23 19:17:31]
rory.blanchard
Line 1: Line 1:
-====== Quick & Dirty Exim Management ======+====== Exim Management Command List ======
 Below are some shell commands that can be used to manage Exim and it's email queue. The commands listed below must be run as root. Below are some shell commands that can be used to manage Exim and it's email queue. The commands listed below must be run as root.
  
-==== Managing Exim Itself ====+===== Managing Exim Itself =====
  
 Start/Stop/Restart Exim Start/Stop/Restart Exim
-<code console>/etc/init.d/exim start|stop|restart</code>+<code> 
 +/etc/init.d/exim start|stop|restart 
 +</code>
  
 Print what Exim is doing right now Print what Exim is doing right now
-<code console>exiwhat</code>+<code> 
 +exiwhat 
 +</code>
  
 Test how exim will route a given email address Test how exim will route a given email address
-<code console>exim -bt email@address.tld</code>+<code> 
 +exim -bt email@address.tld 
 +</code>
  
 Generate and display Exim stats from a logfile Generate and display Exim stats from a logfile
-<code console>eximstats /path/to/exim_mainlog</code>+<code> 
 +eximstats /path/to/exim_mainlog 
 +</code>
  
 Run a pretend SMTP transaction from the command line, as if it were coming from the given IP address. This will display Exim’s checks, ACLs, and filters as they are applied. Replace x.x.x.x with the IP you want to use as the source Run a pretend SMTP transaction from the command line, as if it were coming from the given IP address. This will display Exim’s checks, ACLs, and filters as they are applied. Replace x.x.x.x with the IP you want to use as the source
  
-<code console>exim -bh x.x.x.x</code>+<code> 
 +exim -bh x.x.x.x 
 +</code>
  
 Display all of Exim’s configuration settings Display all of Exim’s configuration settings
  
-<code console>exim -bP</code> +<code> 
- +exim -bP 
-==== Queue Information ====+</code> 
 +\\ 
 +\\ 
 +===== Queue Information =====
  
 Print a count of messages in the queue Print a count of messages in the queue
-<code console>exim -bpc</code>+<code> 
 +exim -bpc 
 +</code>
  
 Print a listing of the messages in the queue (time queued, size, message-id, sender, recipient) Print a listing of the messages in the queue (time queued, size, message-id, sender, recipient)
-<code console>exim -bp</code>+<code> 
 +exim -bp 
 +</code>
  
 Print a summary of messages in the queue (count, volume, oldest, newest, domain, and totals) Print a summary of messages in the queue (count, volume, oldest, newest, domain, and totals)
-<code console>exim -bp | exiqsumm</code> +<code> 
- +exim -bp | exiqsumm 
-==== Searching the Queue ====+</code> 
 +\\ 
 +\\ 
 +===== Searching the Queue =====
  
 Search the queue for messages from a specific sender Search the queue for messages from a specific sender
  
-<code console>exiqgrep -f [user]@domain</code>+<code> 
 +exiqgrep -f [user]@domain 
 +</code>
  
 Search the queue for messages for a specific recipient/domain Search the queue for messages for a specific recipient/domain
  
-<code console>exiqgrep -r [user]@domain</code>+<code> 
 +exiqgrep -r [user]@domain 
 +</code>
  
 Print just the message-id as a result of one of the above two searches Print just the message-id as a result of one of the above two searches
  
-<code console>exiqgrep -i [ -r | -f ] ...</code>+<code> 
 +exiqgrep -i [ -r | -f ] ... 
 +</code>
  
 Print a count of messages matching one of the above searches Print a count of messages matching one of the above searches
  
-<code console>exiqgrep -c [ -r | -f ] ...</code>+<code> 
 +exiqgrep -c [ -r | -f ] ... 
 +</code>
  
 Print just the message-id of the entire queue Print just the message-id of the entire queue
  
-<code console>exiqgrep -i</code>+<code> 
 +exiqgrep -i 
 +</code>
  
-==== Viewing Messages In The Queue ====+Print just the message-id of frozen messages in the queue 
 + 
 +<code> 
 +exiqgrep -iz 
 +</code> 
 +\\ 
 +\\ 
 +===== Viewing Messages In The Queue =====
  
 View a message's headers: View a message's headers:
  
-<code console>exim -Mvh <message-id></code>+<code> 
 +exim -Mvh <message-id> 
 +</code>
  
 View a message's body: View a message's body:
  
-<code console>exim -Mvb <message-id></code>+<code> 
 +exim -Mvb <message-id> 
 +</code>
  
 View a message's logs: View a message's logs:
  
-<code console>exim -Mvl <message-id></code> +<code> 
- +exim -Mvl <message-id> 
-==== Queue Management ====+</code> 
 +\\ 
 +\\ 
 +===== Queue Management =====
  
 Start a queue run Start a queue run
-<code console>exim -q -v</code>+<code> 
 +exim -q -v 
 +</code>
  
 Start a queue run for just local deliveries Start a queue run for just local deliveries
-<code console>exim -ql -v</code>+<code> 
 +exim -ql -v 
 +</code>
  
 Remove a message from the queue Remove a message from the queue
-<code console>exim -Mrm <message-id></code>+<code> 
 +exim -Mrm <message-id> 
 +</code>
  
 Remove all messages older than X seconds from the queue(for example 5 days would be 432000 seconds) Remove all messages older than X seconds from the queue(for example 5 days would be 432000 seconds)
-<code console>exiqgrep -o 432000 -i | xargs exim -Mrm</code>+<code> 
 +exiqgrep -o 432000 -i | xargs -P25 exim -Mrm 
 +</code>
  
 Freeze all queued mail from a sender Freeze all queued mail from a sender
-<code console>exiqgrep -i -f email@address.tld | xargs exim -Mf</code>+<code> 
 +exiqgrep -i -f email@address.tld | xargs exim -Mf 
 +</code>
  
 View a queued message's header View a queued message's header
-<code console>exim -Mvh <message-id></code>+<code> 
 +exim -Mvh <message-id> 
 +</code>
  
 View a queued message's body View a queued message's body
-<code console>exim -Mvb <message-id></code>+<code> 
 +exim -Mvb <message-id> 
 +</code>
  
 View a queued message's log View a queued message's log
-<code console>exim -Mvl <message-id></code>+<code> 
 +exim -Mvl <message-id> 
 +</code>
  
-Remove all messages from the queue (usually a bad idea) +Remove all messages from the queue (usually a bad idea), note the -P25 switch passed to xargs.  This option tells xargs to run 25 concurrent exim removal processes. 
-<code console>exiqgrep -i | xargs exim -Mrm </code>+<code> 
 +exiqgrep -i | xargs -P25 exim -Mrm 
 +</code>
  
 +Remove all frozen messages from the queue.
  
-{{tag>how-to exim smx}}+<code> 
 +exiqgrep -iz | xargs -P25 exim -Mrm 
 +</code> 
 +\\ 
 +\\