summaryrefslogtreecommitdiffstats
path: root/mail/antivirus-milter
diff options
context:
space:
mode:
authordinoex <dinoex@FreeBSD.org>2004-03-05 21:36:12 +0000
committerdinoex <dinoex@FreeBSD.org>2004-03-05 21:36:12 +0000
commite077467a62ec6e6fef360249ffcea3f37b59eab7 (patch)
tree72e186c34dcb76921932d0dc7495d0988ec61894 /mail/antivirus-milter
parentf060302a8ad33fe3454adaba41c9427087d60982 (diff)
downloadFreeBSD-ports-e077467a62ec6e6fef360249ffcea3f37b59eab7.zip
FreeBSD-ports-e077467a62ec6e6fef360249ffcea3f37b59eab7.tar.gz
- add support for clamav/clamdscan
Diffstat (limited to 'mail/antivirus-milter')
-rw-r--r--mail/antivirus-milter/Makefile5
-rw-r--r--mail/antivirus-milter/files/patch-antivirus.c73
2 files changed, 76 insertions, 2 deletions
diff --git a/mail/antivirus-milter/Makefile b/mail/antivirus-milter/Makefile
index 7dae7a4..198a750 100644
--- a/mail/antivirus-milter/Makefile
+++ b/mail/antivirus-milter/Makefile
@@ -7,6 +7,7 @@
PORTNAME= antivirus
PORTVERSION= 3.30
+PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= http://www.nmt.edu/~wcolburn/antivirus/
@@ -63,8 +64,8 @@ do-install:
${INSTALL_SCRIPT} ${WRKSRC}/antivirus-milter.sh \
${PREFIX}/etc/rc.d/antivirus-milter.sh.sample
${INSTALL_DATA} ${WRKSRC}/antivirus.conf ${PREFIX}/etc/antivirus.conf-dist
- ${MKDIR} /var/antivirus/spool /var/antivirus/run /var/antivirus/quarantine
- ${CHOWN} -R nobody:nobody /var/antivirus/
+ ${MKDIR} ${ANTIVIRUS_DIR}/spool ${ANTIVIRUS_DIR}/run ${ANTIVIRUS_DIR}/quarantine
+ ${CHOWN} -R nobody:nobody ${ANTIVIRUS_DIR}/
@${ECHO_MSG} "Add to your *.mc configfile:"
@${ECHO_MSG} "INPUT_MAIL_FILTER(\`antivirus', \`S=local:${ANTIVIRUS_DIR}/antivirus.sock, F=')"
diff --git a/mail/antivirus-milter/files/patch-antivirus.c b/mail/antivirus-milter/files/patch-antivirus.c
new file mode 100644
index 0000000..da13da2
--- /dev/null
+++ b/mail/antivirus-milter/files/patch-antivirus.c
@@ -0,0 +1,73 @@
+--- antivirus.c.orig Tue Jul 15 21:27:14 2003
++++ antivirus.c Fri Mar 5 07:56:07 2004
+@@ -85,6 +85,7 @@
+ static char *FORMAT=NULL;
+ static sfsistat avfailcode=0;
+ static int purgevirus=0;
++static int skipwords=0;
+ static char *avargs[]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
+
+ /*
+@@ -128,6 +129,12 @@
+ #define FORMAT_SOPHOS ">>> Virus '%[^']s' found in file %*s"
+
+ /*
++** This one is for clamav
++*/
++#define FORMAT_CLAMAV " %s FOUND"
++#define SCANARGS_CLAMAV "--disable-summary"
++
++/*
+ ** this can be given on the command line
+ */
+ static char *configfile=NULL;
+@@ -502,6 +509,7 @@
+ int retval;
+ int fd;
+ int i;
++ char *word;
+ char *p=NULL;
+ char *av[]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
+
+@@ -558,7 +566,14 @@
+ memset(viruses,0,sizeof(buf));
+ while (fgets(buf,sizeof(buf),priv->childfp)!=NULL)
+ {
+- if (sscanf(buf,format,tmp)==1)
++ word = buf;
++ if (skipwords > 0 )
++ {
++ word = strchr( word, ' ' );
++ if ( word == NULL )
++ word = buf;
++ }
++ if (sscanf(word,format,tmp)==1)
+ {
+ if (viruses[0])
+ strncat(viruses," ",sizeof(viruses));
+@@ -1211,6 +1226,7 @@
+ if (AVFAILACTION==NULL) AVFAILACTION=CONF_AVFAILACTION;
+ if (VIRUSACTION==NULL) VIRUSACTION=CONF_VIRUSACTION;
+
++ skipwords = 0;
+ if (strcasecmp(AVPRODUCT,"mcafee")==0)
+ {
+ FORMAT=FORMAT_MCAFEE;
+@@ -1225,10 +1241,16 @@
+ {
+ FORMAT=FORMAT_FSAV;
+ }
++ else if (strcasecmp(AVPRODUCT,"clamav")==0)
++ {
++ FORMAT=FORMAT_CLAMAV;
++ AVSCANARGS=SCANARGS_CLAMAV;
++ skipwords = 1;
++ }
+ else
+ {
+ fprintf(stderr,"init(): unrecognized AVPRODUCT %s\n",AVPRODUCT);
+- fprintf(stderr,"init(): valid values are: mcafee, fsva, sophos\n");
++ fprintf(stderr,"init(): valid values are: mcafee, fsva, sophos, clamav\n");
+ return(-1);
+ }
+
OpenPOWER on IntegriCloud