#!/usr/bin/perl #----------------------------------------------------------------------------- # # POPular -- A POP3 server and proxy for large mail systems # # $Id: log-raw2xml,v 1.2 2002/09/15 12:27:14 sqrt Exp $ # # http://www.remote.org/jochen/mail/popular/ # #----------------------------------------------------------------------------- # # Copyright (C) 1999-2002 Jochen Topf # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA # #----------------------------------------------------------------------------- use strict; my @all; my $num; my $text; while (<>) { if (/^:([0-9a-f]{4}):(...):([a-z_]+):(.*):([0-9]+)$/) { push(@{$all[$num]}, $text) if ($num); $num = hex($1); $all[$num] = [ $1, $2, $3, $4, $5 ]; $text = ""; } else { $text .= $_; } } print <<"EOF"; EOF foreach (0..@all) { if (defined $all[$_]) { print <<"EOF"; $all[$_]->[3] $all[$_]->[4] EOF write; print <<"EOF"; EOF } } print "\n"; exit 0; #----------------------------------------------------------------------------- format = ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~ $all[$_]->[5] . #-- THE END ------------------------------------------------------------------