#! /bin/sh /usr/share/dpatch/dpatch-run
## 92_quiet_spamd.dpatch by dean gaudet <dean@arctic.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad spamassassin-3.0.1/spamd/spamd.raw /home/dean/tmp/dpep.CwFxrM/spamassassin-3.0.1/spamd/spamd.raw
--- spamassassin-3.0.1/spamd/spamd.raw	2004-10-29 22:04:40.000000000 -0700
+++ /home/dean/tmp/dpep.CwFxrM/spamassassin-3.0.1/spamd/spamd.raw	2004-10-29 22:11:04.000000000 -0700
@@ -847,7 +847,7 @@
     sigprocmask( POSIX::SIG_UNBLOCK(), $sigset )
       or die "Can't unblock SIGINT for fork: $!\n";
     $children{$pid} = 1;
-    logmsg("server successfully spawned child process, pid $pid");
+    logmsg("server successfully spawned child process, pid $pid") if ($opt{'debug'});
     return;
   }
   else {
@@ -942,7 +942,7 @@
   if ( $opt{'socketpath'} ) {
     $remote_hostname = 'localhost';
     $remote_hostaddr = '127.0.0.1';
-    logmsg( "got connection over " . $opt{'socketpath'} );
+    logmsg( "got connection over " . $opt{'socketpath'} ) if ($opt{'debug'});
   }
   else {
     my ( $port, $ip ) = sockaddr_in( $client->peername );
@@ -1396,7 +1396,7 @@
       die;                            # make it fatal to avoid security breaches
     }
     else {
-      logmsg("info: setuid to $username succeeded");
+      logmsg("info: setuid to $username succeeded") if ($opt{'debug'});
     }
     # increase paranoia when we only handle one client per child
     if ($clients_per_child == 1) {
@@ -1771,7 +1771,7 @@
 sub child_handler {
   my ($sig) = @_;
 
-  unless ($main::INHIBIT_LOGGING_IN_SIGCHLD_HANDLER) {
+  if ($opt{'debug'} and !$main::INHIBIT_LOGGING_IN_SIGCHLD_HANDLER) {
     logmsg("server hit by SIG$sig");
   }
 
@@ -1780,7 +1780,7 @@
     # remove them from our child listing
     delete $children{$pid};
 
-    unless ($main::INHIBIT_LOGGING_IN_SIGCHLD_HANDLER) {
+    if ($opt{'debug'} and !$main::INHIBIT_LOGGING_IN_SIGCHLD_HANDLER) {
       logmsg("handled cleanup of child pid $pid");
     }
   }
