Saturday, September 25, 2010

Exim Commands

Some useful Exim Commands

Queues information

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print a count of the messages in the queue:
Quote:
# exim -bpc

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Generate and display Exim stats from a logfile:
Quote:
# eximstats /path/to/exim_mainlog

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Generate and display Exim stats from a logfile, with less verbose output:
Quote:
# eximstats -ne -nr -nt /path/to/exim_mainlog

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Generate and display Exim stats from a logfile, for one particular day:
Quote:
# fgrep 2007-02-16 /path/to/exim_mainlog | eximstats

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print what Exim is doing right now:
Quote:
# exiwhat

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To delete frozen emails
Quote:
exim -bp | awk ‘$6~”frozen” { print $3 }’ | xargs exim -Mrm

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To deliver emails forcefully
Quote:
exim -qff -v -C /etc/exim.conf &

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To delete nobody mails
Quote:
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:

Quote:
# exiqgrep -f [luser]@domain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Search the queue for messages for a specific recipient/domain:
Quote:
# exiqgrep -r [luser]@domain
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print just the message-id as a result of one of the above two searches:
Quote:
# exiqgrep -i [ -r | -f ] …
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print a count of messages matching one of the above searches:
Quote:
# exiqgrep -c [ -r | -f ] …
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Print just the message-id of the entire queue:
Quote:
# exiqgrep -i
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Managing the queue, Start a queue run:
Quote:
# exim -q -v
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Start a queue run for just local deliveries:
Quote:
# exim -ql -v
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove a message from the queue:
Quote:
# exim -Mrm [ ... ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Freeze a message:
Quote:
# exim -Mf [ ... ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thaw a message:
Quote:
# exim -Mt [ ... ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Deliver a specific message:
Quote:
# exim -M [ ... ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Force a message to fail and bounce:
Quote:
# exim -Mg [ ... ]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove all frozen messages:
Quote:
# exiqgrep -z -i | xargs exim -Mrm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Remove all messages older than five days (86400 * 5 = 432000 seconds):
Quote:
# exiqgrep -o 1296000 -i | xargs exim -Mrm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Freeze all queued mail from a given sender:
Quote:
# exiqgrep -i -f luser@example.tld | xargs exim -Mf
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View a message’s headers:
Quote:
# exim -Mvh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View a message’s body:
Quote:
# exim -Mvb
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
View a message’s logs:
Quote:
# exim -Mvl

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews