[plug] app needed

Leon Brooks leon at brooks.fdns.net
Thu Feb 20 21:22:11 WST 2003


On Thursday 20 February 2003 05:14 pm, Jon Miller wrote:
> Anyone know of a application that can run on Windows that can extract
> certain information from a Linux maillog file, both active and rotated.  It
> needs to be simple to use.  What the person is looking for is to be able to
> put in the application a users name and have the application return
> information showing both inbound and outbound e-mail for the user(s).

Why try to make the silly Windows box do anything useful? (-:

gawk </var/log/mail/info 'BEGIN { print "<HTML><BODY BGCOLOR=WHITE>" } \
  /to=</ { c = "BLUE" } \
  /from=\</ { c = "GREEN" } \
  /=<$USER_NAME_HERE\@/ { print "<P><FONT COLOR=" c ">" \
    gensub(">","\\>","g",gensub("<","\\<","g",$0)) "</FONT></P>" } \
  END { print "</BODY></HTML>" }'

Attached (3.5kB), the results of running that on my own machine, which doesn't 
recieve mail directly. It would be fairly easy to make that more legible 
(e.g. by including only the timestamp, address and server details and 
wrapping each in <TD>...</TD> and the lines in <TR>).

You could also whack CygWin on to the Windows box and run that same command.

Cheers; Leon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.plug.org.au/pipermail/plug/attachments/20030220/1a454dc2/attachment.html>


More information about the plug mailing list