--- simscan-1.4.0/simscan.c 2007-10-29 14:15:05.000000000 +0000 +++ simscan-1.4.0-patched/simscan.c 2008-10-27 10:34:10.000000000 +0000 @@ -1361,6 +1361,53 @@ add_run_scanner(RCVD_SPAM_KEY); #endif + /* **Daz** 06/12/2005 - Reordered to be more logical * + * Changed: Spam Passthrough should take priority over spam hits, since the spam hits + * checks will only ever drop/reject the mail. + * + * Added: Since spam_passthru will always pass the email through, we make an added check + * to see what *would* have been done with the email if it wasn't. In other words, + * we check to see whether it was 'CLEAN' or not. + */ +#ifdef ENABLE_SPAM_PASSTHRU + #ifdef ENABLE_PER_DOMAIN + if ( PerDomainSpamPassthru == 1) { + if (( IsSpam == 1 ) && (DebugFlag > 0)){ + fprintf(stderr, + "simscan: delivering spam because spam-passthru is defined in this domain\n"); + } +#ifdef SPAM_HITS + if ( (PerDomainHits==1 && (SpamHits >= PDHits)) || (PerDomainHits==0 && ( SpamHits >= SPAM_HITS )) ) { + log_message("PASSTHRU", Subject,1); + } else { + log_message("CLEAN", Subject,1); + } +#else + log_message("PASSTHRU", Subject,1); +#endif + return(0); + } else { + if ( IsSpam == 1 ) { +#ifdef ENABLE_DROPMSG + log_message("SPAM DROPPED", Subject, 1); +#else + log_message("SPAM REJECT", Subject,1); +#endif + return(1); + } else { + log_message("CLEAN", Subject,1); + } + } + #else + if ( IsSpam == 1 ) { + log_message("PASSTHRU", Subject,1); + } else { + log_message("CLEAN", Subject,1); + } + return(0); + #endif +#else + #ifdef SPAM_HITS if ( PerDomainHits==1 && ( SpamHits >= PDHits ) ) { #ifdef ENABLE_DROPMSG @@ -1388,37 +1435,6 @@ log_message("CLEAN", Subject,1); } #else - -#ifdef ENABLE_SPAM_PASSTHRU - #ifdef ENABLE_PER_DOMAIN - if ( PerDomainSpamPassthru == 1) { - if (( IsSpam == 1 ) && (DebugFlag > 0)){ - fprintf(stderr, - "simscan: delivering spam because spam-passthru is defined in this domain\n"); - } - log_message("PASSTHRU", Subject,1); - return(0); - } else { - if ( IsSpam == 1 ) { -#ifdef ENABLE_DROPMSG - log_message("SPAM DROPPED", Subject, 1); -#else - log_message("SPAM REJECT", Subject,1); -#endif - return(1); - } else { - log_message("CLEAN", Subject,1); - } - } - #else - if ( IsSpam == 1 ) { - log_message("PASSTHRU", Subject,1); - } else { - log_message("CLEAN", Subject,1); - } - return(0); - #endif -#else if ( IsSpam == 1 ) { #ifdef ENABLE_DROPMSG log_message("SPAM DROPPED", Subject, 1); @@ -1734,7 +1750,15 @@ PerDomainClam = 0; PerDomainSpam = 0; PerDomainTrophie = 0; + /* **Daz** 06/12/2005 + * If --enable-spam-passthru is defined (y), the default behaviour + * is to allow spam through. + */ +#ifdef ENABLE_SPAM_PASSTHRU + PerDomainSpamPassthru = 1; +#else PerDomainSpamPassthru = 0; +#endif per_domain_lookup(""); } @@ -2288,7 +2312,11 @@ if ( spam == 1 ) { #ifdef ENABLE_SPAM if ( PerDomainHits == 1 ) reqhits = PDHits; +#ifdef SPAM_HITS + else reqhits = SPAM_HITS; +#else else reqhits = ReqHits; +#endif fprintf(stderr, "simscan:[%d]:%s (%.2f/%.2f):%3.4fs:%s:%s:%s:%s", getppid(), state, SpamHits,reqhits, utime, subject, getenv("TCPREMOTEIP"), MailFrom, RcptTo[0]);