This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
exchange:reporting:parse_allexchange.pl [2010/03/06 10:08] ben created |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== parse_allExchange.pl ====== | ||
- | <code> | ||
- | #!/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 "-- ", $_ ; | ||
- | </code> |