7 use lib "$FindBin::Bin/../lib", '/opt/clearscm/lib';
15 my $userid = $ENV{USER};
24 open my $file, '<', $filename
25 or error "Unable to open $filename - $!", 1;
31 my @address = split /\@/, $fields[0];
33 $item{pattern} = $address[0];
34 $item{domain} = $address[1];
35 $item{comment} = $fields[1] ? $fields[1] : '';
36 $item{hit_count} = $fields[2] ? $fields[2] : 0;
50 my $nextseq = GetNextSequenceNo($userid, $type);
55 my $pattern = $item{pattern};
56 my $domain = $item{domain};
57 my $comment = $item{comment};
58 my $hit_count = $item{hit_count};
60 display_nolf "Adding $pattern\@$domain ($comment) to null list ($nextseq)...";
62 last if ((!defined $pattern || $pattern eq '') &&
63 (!defined $domain || $domain eq ''));
65 $sender = lc ("$pattern\@$domain");
67 if (OnNulllist($sender)) {
68 display ' Already on list';
70 Add2Nulllist($sender, $userid, $comment, $hit_count);
73 # Now remove this entry from the other lists (if present)
74 for my $otherlist ('white', 'black') {
75 my $sth = FindList($otherlist, $sender);
76 my ($sequence, $count);
78 ($_, $_, $_, $_, $_, $sequence) = GetList($sth);
81 $count = DeleteList($otherlist, $sequence);
98 error "Must specify a filename of addresses to null list", 1;
103 $Userid = ucfirst $userid;
105 Add2List(GetItems ($filename));