Logging scores of non-spam (patch)

Walker Aumann walkera-mailscanner at OFB.NET
Wed Jan 21 19:14:19 GMT 2004


For my site, I thought it could be interesting to know the scores of mail
getting through MailScanner/SpamAssassin without having to archive all
the messages, to get an idea of how close messages were getting to the
threshhold.  The following two patches (against MailScanner 4.25-14) add
a "Log Non Spam" option that works just like the "Log Spam" option.
Hopefully someone else will also find this data useful.

Walker
-------------- next part --------------
*** ConfigDefs.pl       2003-12-02 03:44:42.000000000 -0800
--- ConfigDefs.pl.new   2004-01-12 10:34:56.000000000 -0800
***************
*** 169,174 ****
--- 169,175 ----
  debugspamassassin     0       no      0       yes     1
  deliverinbackground   1       no      0       yes     1
  logspam                       1       no      0       yes     1
+ lognonspam            0       no      0       yes     1
  logspeed              0       no      0       yes     1
  logmcp                        0       no      0       yes     1
  expandtnef            1       no      0       yes     1
-------------- next part --------------
*** Message.pm  2004-01-12 10:25:20.000000000 -0800
--- Message.pm.new      2004-01-12 10:37:48.000000000 -0800
***************
*** 273,278 ****
--- 273,279 ----
    my $RBLsaysspam   = 0;
    my $rblcounter    = 0;
    my $LogSpam = MailScanner::Config::Value('logspam');
+   my $LogNonSpam = MailScanner::Config::Value('lognonspam');
    my $LocalSpamText = MailScanner::Config::LanguageValue($this, 'spam');

    # Construct a pretty list of all the unique domain names for logging
***************
*** 442,448 ****
    }

    # Do the spam logging here so we can log high-scoring spam too
!   if ($LogSpam && $this->{isspam}) {
      my $ReportText = $spamheader;
      $ReportText =~ s/\s+/ /sg;
      MailScanner::Log::InfoLog("Message %s from %s (%s) to %s is %s",
--- 443,449 ----
    }

    # Do the spam logging here so we can log high-scoring spam too
!   if (($LogSpam && $this->{isspam}) or $LogNonSpam) {
      my $ReportText = $spamheader;
      $ReportText =~ s/\s+/ /sg;
      MailScanner::Log::InfoLog("Message %s from %s (%s) to %s is %s",


More information about the MailScanner mailing list