diff -uNr messagewall-devel/messagewallstats.c messagewall-devel-new/messagewallstats.c --- messagewall-devel/messagewallstats.c 2002-09-30 04:08:51.000000000 +0200 +++ messagewall-devel-new/messagewallstats.c 2003-02-03 15:02:51.000000000 +0100 @@ -48,6 +48,8 @@ struct counter *virus = NULL; struct counter *encoding = NULL; struct counter *illegal_multipart = NULL; +struct counter *dnsbl_domain_spam_score = NULL; +struct counter *dnsbl_spam_score = NULL; void increment(struct counter **head, char *name) { struct counter *temp; @@ -275,6 +277,15 @@ *end = '\0'; increment(&dnsbl,start); } + + if (end != NULL) { + start = end + 1; + end = strchr(start, ':'); + *end = '\0'; + + increment(&dnsbl_spam_score,start); + } + continue; } @@ -286,6 +297,21 @@ *end = '\0'; increment(&dnsbl_domain,start); } + + if (end != NULL) { + end++; + start = strchr(end, ':'); + *start = '\0'; + start = strchr(end, '.'); + if (strchr(start+1, '.') != NULL) { + start++; + } + else { + start = end; + } + increment(&dnsbl_domain_spam_score,start); + } + continue; } @@ -613,5 +639,12 @@ fprintf(stdout,"\tBytes received: %0.f\n",bytes_total); fprintf(stdout,"\tBytes rejected: %0.f\n",bytes_total - bytes_delivered); fprintf(stdout,"\tBytes accepted: %0.f\n",bytes_delivered); + + fprintf(stdout, "\nSpammers"); + fprintf(stdout, "\n\tDomain based:\n"); + print(dnsbl_domain_spam_score,"\t\t"); + fprintf(stdout, "\n\tIP based:\n"); + print(dnsbl_spam_score,"\t\t"); + exit(0); }