From e9ff70ef02494d7716aed0a63898e77ffcf73dbb Mon Sep 17 00:00:00 2001 From: ianmdlvl Date: Sun, 26 May 2002 18:59:40 +0000 Subject: [PATCH] --mail-final-test --- scripts/named-conf | 17 ++++++++++------- scripts/named-conf.8 | 6 ++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/scripts/named-conf b/scripts/named-conf index 1520fd8..39bee7f 100755 --- a/scripts/named-conf +++ b/scripts/named-conf @@ -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=''; } - 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; } @@ -760,7 +763,7 @@ sub mail_zone_after () { 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)) { @@ -772,7 +775,7 @@ sub mail_zone_after () { } @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) @@ -815,8 +818,8 @@ Subject: $zone - configuration problems report 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 <close; diff --git a/scripts/named-conf.8 b/scripts/named-conf.8 index a14765c..feded3b 100644 --- a/scripts/named-conf.8 +++ b/scripts/named-conf.8 @@ -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). +.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 -- 2.30.2