git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@305 77e5149b-7576-45b1-b177-96237e5ba77b
Nigel Horne authored on 2004/02/18 22:30:34... | ... |
@@ -231,9 +231,13 @@ |
231 | 231 |
* 0.67a 16/2/04 Added clamfi_free |
232 | 232 |
* 0.67b 17/2/04 Removed compilation warning - now compiles on FreeBSD5.2 |
233 | 233 |
* Don't allow --force to overwride TCPwrappers |
234 |
+ * 0.67c 18/2/04 Added dont-log-clean flag |
|
234 | 235 |
* |
235 | 236 |
* Change History: |
236 | 237 |
* $Log: clamav-milter.c,v $ |
238 |
+ * Revision 1.49 2004/02/18 13:30:34 nigelhorne |
|
239 |
+ * Added dont-long-clean argument |
|
240 |
+ * |
|
237 | 241 |
* Revision 1.48 2004/02/18 10:06:51 nigelhorne |
238 | 242 |
* Fix FreeBSD |
239 | 243 |
* |
... | ... |
@@ -363,9 +367,9 @@ |
363 | 363 |
* Revision 1.6 2003/09/28 16:37:23 nigelhorne |
364 | 364 |
* Added -f flag use MaxThreads if --max-children not set |
365 | 365 |
*/ |
366 |
-static char const rcsid[] = "$Id: clamav-milter.c,v 1.48 2004/02/18 10:06:51 nigelhorne Exp $"; |
|
366 |
+static char const rcsid[] = "$Id: clamav-milter.c,v 1.49 2004/02/18 13:30:34 nigelhorne Exp $"; |
|
367 | 367 |
|
368 |
-#define CM_VERSION "0.67b" |
|
368 |
+#define CM_VERSION "0.67c" |
|
369 | 369 |
|
370 | 370 |
/*#define CONFDIR "/usr/local/etc"*/ |
371 | 371 |
|
... | ... |
@@ -558,6 +562,9 @@ static int threadtimeout = CL_DEFAULT_SCANTIMEOUT; /* |
558 | 558 |
* number of seconds to wait for clamd to |
559 | 559 |
* respond |
560 | 560 |
*/ |
561 |
+static int logClean = 1; /* |
|
562 |
+ * Add clean items to the log file |
|
563 |
+ */ |
|
561 | 564 |
static char *signature = "-- \nScanned by ClamAv - http://www.clamav.net\n"; |
562 | 565 |
static time_t signatureStamp; |
563 | 566 |
|
... | ... |
@@ -597,7 +604,8 @@ help(void) |
597 | 597 |
|
598 | 598 |
puts("\t--bounce\t\t-b\tSend a failure message to the sender."); |
599 | 599 |
puts("\t--config-file=FILE\t-c FILE\tRead configuration from FILE."); |
600 |
- puts("\t--debug\t\t-D\tPrint debug messages."); |
|
600 |
+ puts("\t--debug\t\t\t-D\tPrint debug messages."); |
|
601 |
+ puts("\t--dont-log-clean\t-C\tDon't add an entry to syslog that a mail is clean."); |
|
601 | 602 |
puts("\t--dont-scan-on-error\t-d\tPass e-mails through unscanned if a system error occurs."); |
602 | 603 |
puts("\t--force-scan\t\t-f\tForce scan all messages (overrides (-o and -l)."); |
603 | 604 |
puts("\t--help\t\t\t-h\tThis message."); |
... | ... |
@@ -611,7 +619,7 @@ help(void) |
611 | 611 |
puts("\t--quiet\t\t\t-q\tDon't send e-mail notifications of interceptions."); |
612 | 612 |
puts("\t--quarantine=USER\t-Q EMAIL\tQuanrantine e-mail account."); |
613 | 613 |
puts("\t--quarantine-dir=DIR\t-U DIR\tDirectory to store infected emails."); |
614 |
- puts("\t--server=SERVER\t-s SERVER\tHostname/IP address of server(s) running clamd (when using TCPsocket)."); |
|
614 |
+ puts("\t--server=SERVER\t\t-s SERVER\tHostname/IP address of server(s) running clamd (when using TCPsocket)."); |
|
615 | 615 |
puts("\t--sign\t\t\t-S\tAdd a hard-coded signature to each scanned message."); |
616 | 616 |
puts("\t--signature-file\t-F\tLocation of signature file."); |
617 | 617 |
puts("\t--version\t\t-V\tPrint the version number of this software."); |
... | ... |
@@ -662,9 +670,9 @@ main(int argc, char **argv) |
662 | 662 |
for(;;) { |
663 | 663 |
int opt_index = 0; |
664 | 664 |
#ifdef CL_DEBUG |
665 |
- const char *args = "bc:DfF:lm:nNop:PqQ:dhHs:SU:Vx:"; |
|
665 |
+ const char *args = "bc:CDfF:lm:nNop:PqQ:dhHs:SU:Vx:"; |
|
666 | 666 |
#else |
667 |
- const char *args = "bc:DfF:lm:nNop:PqQ:dhHs:SU:V"; |
|
667 |
+ const char *args = "bc:CDfF:lm:nNop:PqQ:dhHs:SU:V"; |
|
668 | 668 |
#endif |
669 | 669 |
|
670 | 670 |
static struct option long_options[] = { |
... | ... |
@@ -675,6 +683,9 @@ main(int argc, char **argv) |
675 | 675 |
"config-file", 1, NULL, 'c' |
676 | 676 |
}, |
677 | 677 |
{ |
678 |
+ "dont-log-clean", 0, NULL, 'C' |
|
679 |
+ }, |
|
680 |
+ { |
|
678 | 681 |
"dont-scan-on-error", 0, NULL, 'd' |
679 | 682 |
}, |
680 | 683 |
{ |
... | ... |
@@ -755,6 +766,9 @@ main(int argc, char **argv) |
755 | 755 |
case 'c': /* where is clamav.conf? */ |
756 | 756 |
cfgfile = optarg; |
757 | 757 |
break; |
758 |
+ case 'C': /* dont log clean */ |
|
759 |
+ logClean = 0; |
|
760 |
+ break; |
|
758 | 761 |
case 'd': /* don't scan on error */ |
759 | 762 |
cl_error = SMFIS_ACCEPT; |
760 | 763 |
break; |
... | ... |
@@ -1878,7 +1892,7 @@ clamfi_eom(SMFICTX *ctx) |
1878 | 1878 |
* TODO: if privdata->from is NULL it's probably SPAM, and |
1879 | 1879 |
* me might consider bouncing it... |
1880 | 1880 |
*/ |
1881 |
- if(use_syslog) |
|
1881 |
+ if(use_syslog && logClean) |
|
1882 | 1882 |
/* Include the sendmail queue ID in the log */ |
1883 | 1883 |
syslog(LOG_NOTICE, "%s: clean message from %s", |
1884 | 1884 |
smfi_getsymval(ctx, "i"), |