Craig Tinson wrote:
ok.. after a bit of messing around.. and a nice link at: http://www.tldp.org/LDP/abs/html/textproc.htmlthis is probably asking a bit much.. but no harm in asking..
I currently have a spare 14" monitor connected to the mail server so I can monitor whats going on..
it is permanently running the following:
tail -f /var/log/maillog | grcat conf.log
this displays the following in various colors:
Jun 22 20:19:26 www spamd[19421]: processing message <200406222219.09205.blogs@xxxxxxx> for craig@xxxxxxxxxx:510.
Jun 22 20:19:27 www spamd[19421]: clean message (-4.8/5.0) for craig@xxxxxxxxxx:510 in 1.4 seconds, 3206 bytes.
Jun 22 20:20:20 www spamd[2904]: connection from localhost.localdomain [127.0.0.1] at port 33969
Jun 22 20:20:20 www spamd[19441]: processing message <200406221521.59668.joe@xxxxxxxxx> for craig@xxxxxxxxxx:510.
Jun 22 20:20:23 www spamd[19441]: clean message (-3.9/5.0) for craig@xxxxxxxxxx:510 in 2.1 seconds, 3484 bytes.
etc etc
this is more info than I need and just clutters up (and wraps around) on the 14" monitor..
is there an obvious/easy way to trim it.. for example:
Jun 22 - (20:19:26) Mail From: <someone@xxxxxxxxxxxxxx> to <craig@xxxxxxxxxx> (Clean)
Jun 22 - (20:20:30) Mail From: <someone@xxxxxxxxxxxxxx> to <craig@xxxxxxxxxx> (Spam)
colored and columned?
I know this is asking a bit much.. but thought I'd ask...
Cheers
Craig
and Scots grep idea..
have come up with (long winded and probably a roundabout way):
tail -f /var/log/maillog | grep -v imapd |grep -v connection |grep -v processing| \
cut -d" " -f0,3,6,7,8,9,10| grcat conf.craig
which outputs:
21:43:03 clean message (-4.9/5.0) for craig@xxxxxxxxxx:510 21:43:26 clean message (-4.9/5.0) for craig@xxxxxxxxxx:510 21:44:18 identified spam (6.1/5.0) for sales@xxxxxxxxxx:510
close enough for me :)
thanks guys!
Craig