Guest User

Untitled

a guest
Jul 19th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. #!/usr/bin/perl
  2. #
  3. # This script takes a series of ARF messages, and stores certain attributes
  4. # about these messages, so that other applications can easily look into
  5. # only the messages that they care about without having to go into lots
  6. # and lots of files.
  7. use strict;
  8. use lib( qw( /abuse/AUP/lib /abuse/AUP/plugins ) );
  9. use Email::ARF::Report;
  10. use MLDBM;
  11. use Fcntl;
  12.  
  13. my %o;
  14. my $dbm = tie %o, 'MLDBM', '/abuse/AUP/bin/complaintdb', O_CREAT|O_RDWR, 0640 or die $!;
  15.  
  16. for( sort( keys %o ) ){
  17. #print "Filename: $_\n";
  18. my $tmp = $o{$_};
  19. my ($filename , $auth, $ips ) = ( $_, undef, undef );
  20. my ($subject, $from, $replyto, $epoch );
  21. for my $k ( keys %$tmp ){
  22. $auth = $tmp->{$k} if $k eq 'auth';
  23. $ips = $tmp->{$k} if $k eq 'ips';
  24. $from = $tmp->{$k} if $k eq 'from';
  25. $replyto = $tmp->{$k} if $k eq 'replyto';
  26. $subject = $tmp->{$k} if $k eq 'subject';
  27. $epoch = $tmp->{$k} if $k eq 'epoch';
  28. }
  29. next unless defined $tmp->{auth};
  30. print "filename:[/data/staff/abuse/fbl/$filename] auth:[$auth] subject:[$subject] from:[$from] replyto:[$replyto] ips:[" . join( ",", @{$ips} ) . "] epoch:[$epoch]\n";
  31. }
Add Comment
Please, Sign In to add comment