Rename variables holding email addresses to better describe their uses
authorJacob Bachmeyer <jcb@gnu.org>
Wed, 16 Nov 2022 00:45:24 +0000 (18:45 -0600)
committerJacob Bachmeyer <jcb@gnu.org>
Wed, 16 Nov 2022 00:45:24 +0000 (18:45 -0600)
gatekeeper.pl

index 1f848a36948e7e9559df58cd3395f9b54053b35a..ffa5ece3cc62c16339cbb07ff94ecb8ffe0f343d 100755 (executable)
@@ -307,12 +307,16 @@ my $email_blacklist = "/home/gatekpr/etc/email_blacklist";
 # List of all package maintainers
 my $maintainers_bypkg = "/home/gatekpr/etc/maintainers.bypkg";
 
-# maintainer e-mail address
-my $maintainer_email = "ftp-upload-report\@gnu.org";
+# E-mail addresses
+{
+  # - public archive of successful upload reports and some errors
+  our $Public_Upload_Archive_Inbox = "ftp-upload-report\@gnu.org";
+  # - unmoderated collector of other errors and copies of some reports
+  our $Internal_Report_Inbox = 'ftp-upload-script@gnu.org';
+}
 
 my $serials_path = "/home/gatekpr/etc/upload-ftp-serials.txt";
 
-my $email_always = 'ftp-upload-script@gnu.org';  # e.g., ftp-upload@gnu.org
 
 # syslog destination
 use constant SYSLOG_APP_IDENT => 'gatekeeper';
@@ -1400,7 +1404,9 @@ sub mail {
   my $subject = shift;
   $subject ||= '';
 
-  my @email_list = ($email_always);
+  our $Internal_Report_Inbox;
+
+  my @email_list = ($Internal_Report_Inbox);
   # Some messages should be sent to the user, some should not
   push (@email_list, @{$info{email}})
     if (defined $info{email} && $send_to_user);
@@ -1418,7 +1424,7 @@ sub mail {
     # the script maintainer anyway.
     ftp_syslog('info',
               "No uploader e-mail address(es) to report this error to!");
-    @email_list = ($email_always);
+    @email_list = ($Internal_Report_Inbox);
   }
 
   my $sender = 'ftp-upload-script@gnu.org';
@@ -1442,7 +1448,7 @@ sub mail {
   local $Text::Wrap::columns = 78;
 
   sendmail($sender,
-          [$email_always, @email_list],
+          [$Internal_Report_Inbox, @email_list],
           [[To         => join ', ', @email_list],
            [From       => $sender],
            [Date       => strftime("%a, %e %b %Y %H:%M:%S %z", localtime)],
@@ -1457,9 +1463,11 @@ sub debug {
   my $msg = shift;
   my $package_name = shift;
 
+  our $Public_Upload_Archive_Inbox;
+
   sendmail('ftp-upload-script@gnu.org',
-          [$maintainer_email],
-          [[To         => $maintainer_email],
+          [$Public_Upload_Archive_Inbox],
+          [[To         => $Public_Upload_Archive_Inbox],
            [From       => 'ftp-upload-script@gnu.org'],
            [Date       => strftime("%a, %e %b %Y %H:%M:%S %z", localtime)],
            [Subject    => ("[$zone_tag gnu-ftp-debug] "