my $master_keyring = "/home/gatekpr/etc/master_pubring.gpg";
+# We sometimes want to exclude e-mail addresses from being emailed.
+# Specifically, e-mail addresses we import from gpg keys - keys are still valid
+# but associated e-mail addresses are not. Ward, 2011-02-08.
+my $email_blacklist = "/home/gatekpr/etc/email_blacklist";
+
my $log_style = 'GNU';
$log_style = 'Alpha' if ($style eq 'alpha');
$log_style = 'Distros' if ($style eq 'distros');
ftp_die("(in $cwd) $msg",$exit_code);
}
+sub exclude_mail_blacklist {
+ my @emaillist = @_;
+ my @blacklist = ();
+ my @tomail = @emaillist;
+ if (-f $email_blacklist) {
+ open(BLACKLIST, "<$email_blacklist");
+ @blacklist = <BLACKLIST>;
+ close(BLACKLIST);
+ chomp(@blacklist);
+
+ my %blacklist = map{$_ => 1 } @blacklist;
+ my %emaillist = map{$_ => 1 } @emaillist;
+
+ @tomail = grep(!defined $blacklist{$_}, @emaillist);
+ }
+
+ return @tomail;
+}
+
# Used for both success and failure.
#
sub mail {
my $sender = 'ftp-upload-script@gnu.org';
$sender = 'ftp-upload@gnu.org' if ($send_to_user); # We really want replies to go to the ftp-upload queue
- # print STDERR "final emails: @email_list\n";
+ @email_list = exclude_mail_blacklist(@email_list);
+
+ #print STDERR "final emails: @email_list\n";
# return @_;
if ($NOMAIL) {