November 2011
« Oct   Dec »

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

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

  root@web-012 [~]# exim -bp
 9h  2.0K 1RSHdk-0003zj-07 <> *** frozen ***

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
    1    2048      9h      9h
    1    2457     42h     42h
    1    1945     22h     22h
    4    8499     42h      9h  TOTAL

4. Print what Exim is doing right now:

 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
7. Use -r to search the queue for messages for a specific recipient/domain:
#exiqgrep -r
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 [] Connection timed out
2011-11-19 15:42:21 <> R=dk_lookuphost T=dk_remote_smtp defer (110): Connection timed out
2011-11-19 16:05:26 [] 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>