chiark / gitweb /
--mail-final-test
authorianmdlvl <ianmdlvl>
Sun, 26 May 2002 18:59:40 +0000 (18:59 +0000)
committerianmdlvl <ianmdlvl>
Sun, 26 May 2002 18:59:40 +0000 (18:59 +0000)
scripts/named-conf
scripts/named-conf.8

index 1520fd8a7da7276339da345e3050e4f36ce2fc2f..39bee7f9ae35c2e949077549ae752c91845b5221 100755 (executable)
@@ -39,7 +39,10 @@ while (@ARGV && $ARGV[0] =~ m/^\-/) {
        last if m/^$/;
        if (m/^(yes|no|force)$/) { m/^./; $mode= $&; $domail=''; }
        elsif (m/^nothing$/) { $mode= 'x'; $domail=''; }
        last if m/^$/;
        if (m/^(yes|no|force)$/) { m/^./; $mode= $&; $domail=''; }
        elsif (m/^nothing$/) { $mode= 'x'; $domail=''; }
-       elsif (m/^mail\-(first|middle|final)/) { $mode='n'; $domail=$1; }
+       elsif (m/^mail\-(first|middle|final|final-test)/) {
+           $mode='n';
+           $domail=$1;
+       }
        elsif (m/^all$/) { $doall=1; }
        elsif (m/^config$/) { $etcfile= loarg(); $where= '--config option'; }
        elsif (m/^glueless$/) { $needglue=0; }
        elsif (m/^all$/) { $doall=1; }
        elsif (m/^config$/) { $etcfile= loarg(); $where= '--config option'; }
        elsif (m/^glueless$/) { $needglue=0; }
@@ -760,7 +763,7 @@ sub mail_zone_after () {
     close $progress_fh or die "$quis: close ${m_base}_history: $!\n";
     $progress_fh= $warn_fh= 'STDERR';
 
     close $progress_fh or die "$quis: close ${m_base}_history: $!\n";
     $progress_fh= $warn_fh= 'STDERR';
 
-    if ($domail eq 'final') {
+    if ($domail =~ m/^final/) {
        if (100*@m_fail <= $$cfg{'mailmwarn'}*(@m_fail + @m_ok)) {
            printf " %-40s ok\n" or die "$quis: mail ok report: $!\n";
        } elsif (zone_style('@',0)) {
        if (100*@m_fail <= $$cfg{'mailmwarn'}*(@m_fail + @m_ok)) {
            printf " %-40s ok\n" or die "$quis: mail ok report: $!\n";
        } elsif (zone_style('@',0)) {
@@ -772,7 +775,7 @@ sub mail_zone_after () {
     }      
 
     @m_fail= @m_ok= ('','')
     }      
 
     @m_fail= @m_ok= ('','')
-       if $domail eq 'final';
+       if $domail =~ m/^final/;
 
     printf $m_info "%s %s %s %s \n",
         $m_time, $m_lastok, join(':',@m_ok), join(':',@m_fail)
 
     printf $m_info "%s %s %s %s \n",
         $m_time, $m_lastok, join(':',@m_ok), join(':',@m_fail)
@@ -815,8 +818,8 @@ Subject: $zone - configuration problems report
 END
 ;
     pmail("To: ");
 END
 ;
     pmail("To: ");
-    pmail("SOA MNAME for $zone <$zone_to>\nCC: ")
-       if length($zone_to);
+    pmail("(testing!) ") if $domail ne 'final';
+    pmail("SOA MNAME for $zone <$zone_to>\nCC: ") if length($zone_to);
     pmail($$cfg{'admin'}."\n\n");
     pmail <<END
 You are receiving this mail because your email address is listed
     pmail($$cfg{'admin'}."\n\n");
     pmail <<END
 You are receiving this mail because your email address is listed
@@ -868,8 +871,8 @@ END
     defined($c= fork) or die "$quis: fork for mail: $!\n";
     if (!$c) {
        open STDIN, "<& ${m_m}" or die "$quis - sendmail: dup for stdin: $!\n";
     defined($c= fork) or die "$quis: fork for mail: $!\n";
     if (!$c) {
        open STDIN, "<& ${m_m}" or die "$quis - sendmail: dup for stdin: $!\n";
-       exec '/usr/sbin/sendmail','-odq','-oee','-oi',
-           'ijackson@chiark.greenend.org.uk'; # should be -t
+       exec (qw(/usr/sbin/sendmail -odq -oee -oi),
+             ($domail eq 'final' ? '-t' : $$cfg{'admin'}));
        die "$quis - sendmail: exec: $!\n";
     }
     $m_m->close;
        die "$quis - sendmail: exec: $!\n";
     }
     $m_m->close;
index a14765cb9e4cb9b76aa05cea582498930ba860f0..feded3bde28d4f9c8a4bed2611d1db7e090f21b2 100644 (file)
@@ -58,6 +58,12 @@ and store the results; \-\-mail\-final also sends a mail to the zone
 SOA MNAME or local administrator, if too many of the calls had errors
 or warnings (calls before the most recent \-\-mail\-first being
 ignored).
 SOA MNAME or local administrator, if too many of the calls had errors
 or warnings (calls before the most recent \-\-mail\-first being
 ignored).
+.TP
+.B \-mail\-final\-test
+just like \-\-mail\-final except that it always sends mail to the
+local server admin and never to remote zone contacts, adding
+.B (testing!)
+to the start of the To: field.
 .LP
 Alternatively, one or more zone names may be supplied as arguments, in
 which case their delegations will be checked, and compared with the
 .LP
 Alternatively, one or more zone names may be supplied as arguments, in
 which case their delegations will be checked, and compared with the