aboutsummaryrefslogtreecommitdiff
path: root/mail/antivirus-milter
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2004-03-05 21:36:12 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2004-03-05 21:36:12 +0000
commite966675fa3c128639b015b24c5e1706e8d2949fa (patch)
tree44d08b63e6955d227675a21efd59478a4af1eecd /mail/antivirus-milter
parent009e93abfc6abb38e15018bffe0ce5b38d003050 (diff)
downloadports-e966675fa3c128639b015b24c5e1706e8d2949fa.tar.gz
ports-e966675fa3c128639b015b24c5e1706e8d2949fa.zip
Notes
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 7dae7a4e84fa..198a7505c7e2 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 000000000000..da13da22fa36
--- /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);
+ }
+