Posted by jerryyang_la1 on 03/25/07 12:07
Hi
My mail server outputs live logs like this:
T 20070325 123318 4605007c Connection from 111.111.111.111
T 20070325 123319 4605007c HELO testdomain.com
T 20070325 125817 46050083 EHLO S010600110962b82a.ed.roguedomain.net
T 20070325 125818 46050083 MAIL FROM: <gqvnwuhku@roguedomain.net>
E 20070325 125823 46050083 Host 68.150.140.71 blocked by
10-12 .sorbs.net C - Block - message tagged.
T 20070325 125824 46050083 RCPT TO: <dignity@newsite.com>
E 20070325 125824 46050083 RCPT from 68.150.140.71 - user
<dignity@newsite.com> not known.
T 20070325 125824 46050083 Connection closed with 68.150.140.71, 7
sec. elapsed.
T 20070325 123349 4605007c Connection closed with 111.111.111.111, 31
sec. elapsed.
T 20070325 125947 46050084 Connection from 83.28.27.71
T 20070325 125947 46050084 HELO drmac.cl
T 20070325 125947 46050084 MAIL FROM: <bitransmitting@drmac.cl>
E 20070325 125948 46050084 Host 83.28.27.71 blocked by
zen.spamhaus.org sbl/xbl/pbl/zen 2 - message tagged.
T 20070325 125948 46050084 RCPT TO: <a1aaa1azzzz1zaaaaa@newsite.com>
E 20070325 125948 46050084 RCPT from 83.28.27.71 - user
<a1aaa1azzzz1zaaaaa@newsite.com> not known.
T 20070325 125949 46050084 Connection closed with 83.28.27.71, 2 sec.
elapsed.
I'm looking to try and read this file via PHP and colourise each line
based on the connection ID displaying the final result in a php
page...
eg:
T 20070325 123318 4605007c Connection from 111.111.111.111
The ID is 4605007c This appears on 3 lines. Note that the ID's are
not always grouped together.
Can this be done ?? The file is live and constantly changing...
Thanks
Navigation:
[Reply to this message]
|