Differences
This shows you the differences between two versions of the page.
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: | ||
- | ====== | + | ====== Exim Management |
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/ | Start/ | ||
- | < | + | < |
+ | / | ||
+ | </ | ||
Print what Exim is doing right now | Print what Exim is doing right now | ||
- | < | + | < |
+ | exiwhat | ||
+ | </ | ||
Test how exim will route a given email address | Test how exim will route a given email address | ||
- | < | + | < |
+ | exim -bt email@address.tld | ||
+ | </ | ||
Generate and display Exim stats from a logfile | Generate and display Exim stats from a logfile | ||
- | < | + | < |
+ | eximstats / | ||
+ | </ | ||
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 | ||
- | < | + | < |
+ | exim -bh x.x.x.x | ||
+ | </ | ||
Display all of Exim’s configuration settings | Display all of Exim’s configuration settings | ||
- | < | + | < |
- | + | exim -bP | |
- | ==== Queue Information ==== | + | </ |
+ | \\ | ||
+ | \\ | ||
+ | ===== Queue Information | ||
Print a count of messages in the queue | Print a count of messages in the queue | ||
- | < | + | < |
+ | exim -bpc | ||
+ | </ | ||
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) | ||
- | < | + | < |
+ | exim -bp | ||
+ | </ | ||
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) | ||
- | < | + | < |
- | + | exim -bp | exiqsumm | |
- | ==== Searching the Queue ==== | + | </ |
+ | \\ | ||
+ | \\ | ||
+ | ===== Searching the Queue ===== | ||
Search the queue for messages from a specific sender | Search the queue for messages from a specific sender | ||
- | < | + | < |
+ | exiqgrep -f [user]@domain | ||
+ | </ | ||
Search the queue for messages for a specific recipient/ | Search the queue for messages for a specific recipient/ | ||
- | < | + | < |
+ | exiqgrep -r [user]@domain | ||
+ | </ | ||
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 | ||
- | < | + | < |
+ | exiqgrep -i [ -r | -f ] ... | ||
+ | </ | ||
Print a count of messages matching one of the above searches | Print a count of messages matching one of the above searches | ||
- | < | + | < |
+ | exiqgrep -c [ -r | -f ] ... | ||
+ | </ | ||
Print just the message-id of the entire queue | Print just the message-id of the entire queue | ||
- | < | + | < |
+ | exiqgrep -i | ||
+ | </ | ||
- | ==== Viewing Messages In The Queue ==== | + | Print just the message-id of frozen messages in the queue |
+ | |||
+ | < | ||
+ | exiqgrep -iz | ||
+ | </ | ||
+ | \\ | ||
+ | \\ | ||
+ | ===== Viewing Messages In The Queue ===== | ||
View a message' | View a message' | ||
- | < | + | < |
+ | exim -Mvh < | ||
+ | </ | ||
View a message' | View a message' | ||
- | < | + | < |
+ | exim -Mvb < | ||
+ | </ | ||
View a message' | View a message' | ||
- | < | + | < |
- | + | exim -Mvl < | |
- | ==== Queue Management ==== | + | </ |
+ | \\ | ||
+ | \\ | ||
+ | ===== Queue Management | ||
Start a queue run | Start a queue run | ||
- | < | + | < |
+ | exim -q -v | ||
+ | </ | ||
Start a queue run for just local deliveries | Start a queue run for just local deliveries | ||
- | < | + | < |
+ | exim -ql -v | ||
+ | </ | ||
Remove a message from the queue | Remove a message from the queue | ||
- | < | + | < |
+ | exim -Mrm < | ||
+ | </ | ||
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) | ||
- | < | + | < |
+ | exiqgrep -o 432000 -i | xargs -P25 exim -Mrm | ||
+ | </ | ||
Freeze all queued mail from a sender | Freeze all queued mail from a sender | ||
- | < | + | < |
+ | exiqgrep -i -f email@address.tld | xargs exim -Mf | ||
+ | </ | ||
View a queued message' | View a queued message' | ||
- | < | + | < |
+ | exim -Mvh < | ||
+ | </ | ||
View a queued message' | View a queued message' | ||
- | < | + | < |
+ | exim -Mvb < | ||
+ | </ | ||
View a queued message' | View a queued message' | ||
- | < | + | < |
+ | exim -Mvl < | ||
+ | </ | ||
- | 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. |
- | < | + | < |
+ | exiqgrep -i | xargs -P25 exim -Mrm | ||
+ | </ | ||
+ | Remove all frozen messages from the queue. | ||
- | {{tag>how-to exim smx}} | + | <code> |
+ | exiqgrep | ||
+ | </ | ||
+ | \\ | ||
+ | \\ |