Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- #
- # This script takes a series of ARF messages, and stores certain attributes
- # about these messages, so that other applications can easily look into
- # only the messages that they care about without having to go into lots
- # and lots of files.
- use strict;
- use lib( qw( /abuse/AUP/lib /abuse/AUP/plugins ) );
- use Email::ARF::Report;
- use MLDBM;
- use Fcntl;
- my %o;
- my $dbm = tie %o, 'MLDBM', '/abuse/AUP/bin/complaintdb', O_CREAT|O_RDWR, 0640 or die $!;
- for( sort( keys %o ) ){
- #print "Filename: $_\n";
- my $tmp = $o{$_};
- my ($filename , $auth, $ips ) = ( $_, undef, undef );
- my ($subject, $from, $replyto, $epoch );
- for my $k ( keys %$tmp ){
- $auth = $tmp->{$k} if $k eq 'auth';
- $ips = $tmp->{$k} if $k eq 'ips';
- $from = $tmp->{$k} if $k eq 'from';
- $replyto = $tmp->{$k} if $k eq 'replyto';
- $subject = $tmp->{$k} if $k eq 'subject';
- $epoch = $tmp->{$k} if $k eq 'epoch';
- }
- next unless defined $tmp->{auth};
- print "filename:[/data/staff/abuse/fbl/$filename] auth:[$auth] subject:[$subject] from:[$from] replyto:[$replyto] ips:[" . join( ",", @{$ips} ) . "] epoch:[$epoch]\n";
- }
Add Comment
Please, Sign In to add comment