Activities

September 2013
M T W T F S S
« Aug   Oct »
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Mail server : EXIM monitoring email activity

1. How to count the queued email.

root@cpanel01 [~]#  exim -bpc
98

r

2. print the email details in the queue

root@cpanel01 [~]# exim -bp | more
62h  2.8K 1VJnPT-0000Mg-BC <supplier@cpanel01.asd.com>
          pmessinger@s.rr.com
62h  2.8K 1VJnUZ-0000gu-1E <supplier@cpanel01.asd.com>
          dbyers@geoen.com
62h  2.9K 1VJnUZ-0000ht-MK <supplier@cpanel01.asd.com>
          dbygj@anderestate.com
62h  2.9K 1VJnWK-0000nX-RT <supplier@cpanel01.asd.com>
          rickyireneg@veson.net

3. Email summery in the queue

#  exim -bp | exiqsumm
Count  Volume  Oldest  Newest  Domain
-----  ------  ------  ------  ------
    1    2457      4d      4d  chat.minakuru.tv
    1    2355     67h     67h  ekk.bg
    1    19KB     20h     20h  jazdzewski.pl
    1    2150     64h     64h  xrm.org
---------------------------------------------------------------
    4    26KB      4d     20h  TOTAL

4. Listing the port which EXIM listening.

root@server217-174-241-227 [~]# exiwhat
 4174 daemon: -q1h, listening for SMTP on port 25 (IPv6 and IPv4) port 587 (IPv6 and IPv4) and for SMTPS on port 465 (IPv6 and IPv4)
root@server217-174-241-227 [~]#

5. Identify the emails are sending to the proper SMTP servers ?

root@server [~]# exim -bt liju@serveridol.com
liju@serveridol.com
  router = lookuphost, transport = remote_smtp
  host aspmx.l.google.com      [2a00:1450:400c:c05::1b] MX=0
  host aspmx.l.google.com      [173.194.67.27]          MX=0
  host ALT1.aspmx.l.google.com [2a00:1450:4001:c02::1a] MX=10

6. Listing EXIM config. settings

root@server217-174-241-227 [~]# exim -bP | more
accept_8bitmime
acl_not_smtp = acl_not_smtp
acl_not_smtp_mime =
acl_not_smtp_start =
acl_smtp_auth =
acl_smtp_connect = acl_smtp_connect
acl_smtp_data = acl_smtp_data
acl_smtp_dkim =
acl_smtp_etrn =
acl_smtp_expn =

7.Search the queue for messages from a specific sender.
exiqgrep -f user@domain.com

root@cpanel01 [~]# exiqgrep -f supplier@cpanel01.asd.com | more
63h  2.8K 1VJnPT-0000Mg-BC <supplier@cpanel01.asd.com>
          pmessinger@sport.rr.com

8. Find the message from a specific recipient in the queue.
#exiqgrep -r user2domain.com

9.List the message id in the queue for starting analysis,

root@cpanel01 [~]# exiqgrep -i | more
1VJnPT-0000Mg-BC
1VJnUZ-0000gu-1E
1VJnUZ-0000ht-MK
1VJnWK-0000nX-RT
1VJnXZ-0000tV-R6

10. Managing the queue

a. Start a queue run:

root@localhost# exim -q -v

b. for local email delivery

exim -ql -v

c. Remove a message from the queue:

exim -Mrm <message-id>

d. lock a message

 exim -Mf <message-id>

e. unlock a message in the queue

exim -Mt <message-id>

f. Remove all locked emails

 exiqgrep -z -i | xargs exim -Mrm

g. Remove all messages older than 1 day (86400 * 1 = 86400 seconds):

  exiqgrep -o 86400 -i | xargs exim -Mrm

11. Viewing email content

a. View a message’s headers:

 exim -Mvh <message-id>

b. View a message’s body:

exim -Mvb <message-id>

c. View a message’s logs:

exim -Mvl <message-id>

12. Generate and display Exim stats from a logfile:

eximstats /path/to/exim_mainlog

root@cpanel01 [~]# eximstats /var/log/exim_mainlog=> mta7.am0.yahoodns.net[98.138.112.37] dakotaheiselman@yahoo.com
      => mta7.am0.yahoodns.net[98.138.112.37] badshultz@yahoo.com
      1 (emzzcx)[87.76.37.212] rikur@battlefield.ca
      => mx1.seznam.cz[77.75.72.42] sorma3on@seznam.cz
      1 (emzzcx)[87.76.37.212] rikur@battlefield.ca
      => mx2.hotmail.com[65.55.92.136] burn123@live.ca

For more detailed report,

#eximstats -ne -nr -nt /var/log/exim_mainlog

13. Remove all the emails from the queue

#exim -bp | exiqgrep -i | xargs exim -Mrm

14. Delete all the emails from a specific sender,

#exiqgrep -ir email@domain.com | xargs exim -Mrm

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>