7 use lib $FindBin::Bin, '/opt/clearscm/lib';
15 my $userid = $ENV{USER};
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 $itme{hit_count} = $fields[2] ? $fields[2] : 0;
48 my $nextseq = MAPSDB::GetNextSequenceNo $userid, $type;
53 my $pattern = $item{pattern};
54 my $domain = $item{domain};
55 my $comment = $item{comment};
56 my $hit_count = $item{hit_count};
58 display_nolf "Adding $pattern\@$domain ($comment) to null list ($nextseq)...";
60 last if ((!defined $pattern || $pattern eq '') &&
61 (!defined $domain || $domain eq ''));
63 $sender = lc ("$pattern\@$domain");
65 if (OnNulllist $sender) {
66 display " Already on list";
68 Add2Nulllist $sender, $userid, $comment, $hit_count;
71 # Now remove this entry from the other lists (if present)
72 foreach my $otherlist ("white", "black") {
73 my $sth = FindList $otherlist, $sender;
74 my ($sequence, $count);
76 ($_, $_, $_, $_, $_, $sequence) = GetList $sth;
79 $count = DeleteList $otherlist, $sequence;
93 error "Must specify a filename of addresses to null list", 1;
98 $Userid = ucfirst $userid;
100 Add2List (GetItems $filename);