From 89ba23b425174ed428bcbc318f947a88025981a8 Mon Sep 17 00:00:00 2001 From: short <> Date: Fri, 28 Dec 2001 20:52:03 +0000 Subject: [PATCH] Secondary request has now Reply-To set to the zone hostmaster - requested by Pavel Ruzicka - "/usr/sbin/sendmail" is now used instead of mail(1) --- check.cgi | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/check.cgi b/check.cgi index 1ab4eff..5f70939 100755 --- a/check.cgi +++ b/check.cgi @@ -158,16 +158,33 @@ EOF while ($c[0] =~ /^-[vh]$/) { shift @c; } $ru = $query->remote_user; ($rh = $query->remote_host) =~ s/[^A-Za-z0-9. \240-\376-]/?/g; - # This might look insecure, but we know all the names have been correctly + + # "@c" might look insecure, but we know all the names have been correctly # validated by the first sleuth run. - `( echo "Domain: $domain" ; - echo "Server: $server [$serverip]" ; - echo "User: $ru" ; - echo "From: $submitter ($rh)" ; - echo ; - ./sleuth @c - ) | mail -s \"New zone\" $secondaries_to`; - $? && print "

Forwarding failed (rc=$?)\n"; + &{sub { + local *HMSLEUTH; + open(HMSLEUTH,"./sleuth -m @c|") or return; + my $hostmaster = ""; # default + /^\. Hostmaster e-mail address is (.*)$/m and $hostmaster=$1 while ; + close HMSLEUTH; + + local *MAILCMD; + open(MAILCMD,"|(cat;./sleuth @c)|/usr/sbin/sendmail -oi -oee -t") or return; + print MAILCMD (!$hostmaster ? "" : "Reply-To: \"Hostmaster for $domain\" <$hostmaster>\n"), + <<"EOF"; +Subject: New zone +To: $secondaries_to + +Domain: $domain +Server: $server [$serverip] +Hostmaster: $hostmaster +User: $ru +From: $submitter ($rh) + +EOF + close MAILCMD; + 1; + }} or print "

Forwarding failed (rc=$?)\n"; } } print "


\n"; -- 1.8.3.1