User Tools

Site Tools


exchange:reporting:parse_allexchange.pl

This is an old revision of the document!


parse_allExchange.pl

#!/opt/local/bin/perl
#
#Take field 12 from the BES stats list and echo it out in an update 
#statement- any user in the list is a BES user, so their bes field 
#gets a '1'

#use warnings;
#use strict;
use Text::CSV;
use Text::CSV::Encoded;
#use locale;

use POSIX qw(locale_h);
#setlocale(LC_CTYPE, "iso-8859-1");
setlocale(LC_CTYPE, "C");

my $fh;
my $usage = "usage: ".$0." mailbox_list.csv\n";

if (@ARGV) { 
        $fh = shift @ARGV; 
        open INFILE, "<:raw:encoding(utf-8)", "$fh" or die $usage;
} 
else { print $usage; exit(1);}

open (ERRFILE, ">error_log.txt") or die "$!\n";

#Generate a big list of safe/allowed ips and currently blocked ips.
#Note "$index" is incremented by both while loops

while (<INFILE>) {

#this can spit out the bad lines, maybe soo to an output file... 
#if ( $_ =~ /[^A-Za-z0-9\s\t\\r\a`\-=\[\]\\;\',\.\/~!@#$%^&\*\(\)_+\{\}\|:\"<>\?)]/ )        {
#                print "-- ", $_ ;
exchange/reporting/parse_allexchange.pl.1267888122.txt.gz ยท Last modified: 2010/03/06 10:08 by ben