2 ################################################################################
4 # File: $RCSfile: nuke,v $
5 # Revision: $Revision: 1.1 $
6 # Description: Displays list of email addresses based on report type.
7 # Author: Andrew@DeFaria.com
8 # Created: Fri Nov 29 14:17:21 2002
9 # Modified: $Date: 2013/06/12 14:05:47 $
12 # (c) Copyright 2000-2006, Andrew@DeFaria.com, all rights reserved.
14 ################################################################################
20 use lib $FinBin::Bin, '/opt/clearscm/lib';
27 my $userid = "andrew";
30 my $type = "mailloop";
34 # Hack: ReturnEmails normally wants a start and end range of what
35 # emails to get. We really want all of them so let's just use 10000.
36 @emails = ReturnEmails $userid, $type, 0, 10000;
41 my $sender = shift @{$_};
43 my ($pattern, $domain) = split (/@/, $sender);
45 if (scalar @msgs > 0) {
46 $senders{$domain} = scalar @msgs;
58 my $nextseq = MAPSDB::GetNextSequenceNo $userid, $type;
63 display_nolf "Adding $domain to null list ($nextseq)...";
65 if (OnNulllist $domain) {
66 display_nolf " Already on list";
70 Add2Nulllist $domain, $userid, "";
73 # Now remove this entry from the other lists (if present)
74 foreach my $otherlist ("white", "black") {
75 my $sth = FindList $otherlist, $domain;
76 my ($sequence, $count);
77 ($_, $_, $_, $_, $_, $sequence) = GetList $sth;
78 if (defined $sequence) {
79 $count = DeleteList $otherlist, $sequence;
89 # Set no output buffering
97 my %senders = GetMailLoops;
99 foreach (sort (keys (%senders))) {
103 if (scalar keys (%senders) eq 0) {
104 display "No mailloops detected";
108 print "Nuke these domains? ";
112 Add2List "null", (sort (keys (%senders)));