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] : "";
47 my $nextseq = MAPSDB::GetNextSequenceNo $userid, $type;
52 my $pattern = $item {pattern};
53 my $domain = $item {domain};
54 my $comment = $item {comment};
56 display_nolf "Adding $pattern\@$domain ($comment) to null list ($nextseq)...";
57 last if ((!defined $pattern || $pattern eq "") &&
58 (!defined $domain || $domain eq ""));
59 $sender = lc ("$pattern\@$domain");
61 if (OnNulllist $sender) {
62 display " Already on list";
64 Add2Nulllist $sender, $userid, $comment;
67 # Now remove this entry from the other lists (if present)
68 foreach my $otherlist ("white", "black") {
69 my $sth = FindList $otherlist, $sender;
70 my ($sequence, $count);
71 ($_, $_, $_, $_, $_, $sequence) = GetList $sth;
72 if (defined $sequence) {
73 $count = DeleteList $otherlist, $sequence;
85 $filename = $ARGV [0];
87 error "Must specify a filename of addresses to null list", 1;
92 $Userid = ucfirst $userid;
94 Add2List (GetItems $filename);