#!/usr/bin/perl -n
use strict;
use vars qw(%Users);

chomp;
my ($domain) = /@([^@]*)/;
push @{$Users{$domain}}, $_;

END {
    for my $domain (sort keys %Users) {
	for my $user (sort @{$Users{$domain}}) {
	    print "$user OK\n";
	}
	print "$domain REJECT\n";
    }
}
