Activities

November 2011
M T W T F S S
« Oct   Dec »
 123456
78910111213
14151617181920
21222324252627
282930  

Exim :- Useful administrative commands

Most of the Whm/Cpanel based servers are using exim as MTA which has flexible spam filter and support virtual domain and users.

1. Print a count of the messages in the queue:
#exim -bpc

  root@web-012 [~]# exim -bpc
   1

2. Print a listing of the messages in the queue
#exim -bp

  root@web-012 [~]# exim -bp
   carlineshirly@power.alstom.com
 9h  2.0K 1RSHdk-0003zj-07 <> *** frozen ***
          alyssa.campbell@lightwave.com

3. Print a summary of messages in the queue
#exim -bp | exiqsumm

 root@web-012 [~]# exim -bp | exiqsumm
Count  Volume  Oldest  Newest  Domain
-----  ------  ------  ------  ------
    1    2048     29h     29h  interstaterelocation.net
    1    2048      9h      9h  lightwave.com
    1    2457     42h     42h  news.cqi.com
    1    1945     22h     22h  power.alstom.com
---------------------------------------------------------------
    4    8499     42h      9h  TOTAL

4. Print what Exim is doing right now:
#exiwhat

 root@web-012 [~]#  exiwhat
   4123 daemon: -q1h, listening for SMTP on port 25 (IPv6 and IPv4) and for SMTPS on port 465 (IPv6 and IPv4)

5. Display all of Exim’s configuration settings:
# exim -bP
6. Use -f to search the queue for messages from a specific sender:
#exiqgrep -f user@domain.com
7. Use -r to search the queue for messages for a specific recipient/domain:
#exiqgrep -r user@domain.com
8. Start a queue run:
#exim -q -v
9. Start a queue run for just local deliveries:
exim -ql -v
10. Remove a message from the queue:
#exim -Mrm

 root@web-012 [~]# exim -Mrm 1RSHdk-0003zj-07
Message 1RSHdk-0003zj-07 has been removed

11. Deliver a message, whether it’s frozen or not, whether the retry time has been reached or not
#exim -M
12. Remove all frozen messages:
#exiqgrep -z -i | xargs exim -Mrm

root@web-012 [~]# exiqgrep -z -i | xargs exim -Mrm
Message 1RRyxQ-0003FJ-Aq has been removed
Message 1RS60i-00079d-NF has been removed

13. Remove all messages older than 1 days (86400 * 1 = 86400 seconds):
#exiqgrep -o 432000 -i | xargs exim -Mrm
14. Freeze all queued mail from a given sender:
#exiqgrep -i -f luser@example.tld | xargs exim -Mf
15. View a message’s headers
#exim -Mvh
16. View a message’s body:
#exim -Mvb
17. View a message’s logs:
#exim -Mvl

root@server-012[~]# exim -Mvl 1RRn0a-0006pW-LV
2011-11-19 15:39:12 Received from <> R=1RRn0V-0006pI-Vl U=mailnull P=local S=2447
2011-11-19 15:42:21 wdncom.uslec.read.readnews.com [198.186.192.186] Connection timed out
2011-11-19 15:42:21 elian.dancey@wdn.com.client.newsread.com <elian.dancey@news.cqi.com> R=dk_lookuphost T=dk_remote_smtp defer (110): Connection timed out
2011-11-19 16:05:26 wdncom.uslec.read.readnews.com [198.186.192.186] Connection timed out

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>