From: unknown Date: Tue, 8 Feb 2011 16:08:42 +0000 (-0600) Subject: Import version as of 2011-02-08 for upload-ftp-v1.1.pl X-Git-Tag: 20200730__import~25 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=313626577ebb27c043e95299714ea654ce1b31f2;p=gatekeeper.git Import version as of 2011-02-08 for upload-ftp-v1.1.pl --- diff --git a/upload-ftp-v1.1.pl b/upload-ftp-v1.1.pl index 5c20d3a..46aea1f 100755 --- a/upload-ftp-v1.1.pl +++ b/upload-ftp-v1.1.pl @@ -150,6 +150,11 @@ my $desttmp = "/var/tmp/$m_style-out"; 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'); @@ -1106,6 +1111,25 @@ sub fatal { 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 = ; + 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 { @@ -1132,7 +1156,9 @@ 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) {