On Mon, Apr 09, 2007 at 08:32:02PM +0200, Matthieu Herrb wrote: > On my (solaris) mail server at work, it happens that clamd returns an > error while parsing bad pdf or zip files, so mimedefangs falls back to > running clamav directly, in which case the patch applies afaict.
Thanks. I've changed the FLAVOR to clamav and removed the --disable-clamav CONFIGURE_ARG for the clamav flavor (so mimedefang can use both clamd and clamav. I also applied the patch. -ME Index: Makefile =================================================================== RCS file: /cvs/ports/mail/mimedefang/Makefile,v retrieving revision 1.2 diff -u -p -r1.2 Makefile --- Makefile 29 Oct 2006 18:34:25 -0000 1.2 +++ Makefile 9 Apr 2007 18:54:43 -0000 @@ -1,9 +1,9 @@ # $OpenBSD: Makefile,v 1.2 2006/10/29 18:34:25 steven Exp $ -COMMENT= "mailfilter to identify and mark spam" +COMMENT= "framework for filtering e-mail" -DISTNAME= mimedefang-2.57 -PKGNAME= ${DISTNAME}p0 +DISTNAME= mimedefang-2.61 +PKGNAME= ${DISTNAME} CATEGORIES= mail perl5 HOMEPAGE= http://www.mimedefang.org/ @@ -13,17 +13,49 @@ PERMIT_PACKAGE_CDROM= Yes PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes -WANTLIB= c m perl pthread util +WANTLIB= c m perl pthread util milter MASTER_SITES= ${HOMEPAGE}static/ -RUN_DEPENDS= :p5-MIME-tools-*:mail/p5-MIME-tools \ - :p5-Digest-SHA1-*:security/p5-Digest-SHA1 +RUN_DEPENDS= :p5-Archive-Zip-*:archivers/p5-Archive-Zip \ + :p5-MIME-tools-*:mail/p5-MIME-tools \ + :p5-Mail-Tools-*:mail/p5-Mail-Tools \ + :p5-HTML-Parser-*:www/p5-HTML-Parser \ + :p5-IO-stringy-*:devel/p5-IO-stringy \ + :p5-Digest-SHA1-*:security/p5-Digest-SHA1 \ + :p5-Unix-Syslog-*:sysutils/p5-Unix-Syslog + BUILD_DEPENDS= ${RUN_DEPENDS} CONFIGURE_STYLE=gnu -CONFIGURE_ARGS= --with-user=_mdefang \ - --disable-anti-virus +CONFIGURE_ARGS= --with-user=_mdefang + +FLAVORS= clamav +FLAVOR?= + +.if ${FLAVOR:L:Mclamav} +CONFIGURE_ARGS+= --disable-antivir \ + --disable-vexira \ + --disable-uvscan \ + --disable-bdc \ + --disable-sweep \ + --disable-trend \ + --disable-AvpLinux \ + --disable-kavscanner \ + --disable-aveclient \ + --disable-fsav \ + --disable-csav \ + --disable-fprot \ + --disable-sophie \ + --disable-nvcc \ + --disable-trophie + +BUILD_DEPENDS+= ::security/clamav +RUN_DEPENDS+= ::security/clamav +MESSAGE= ${PKGDIR}/MESSAGE-clamav +.else +CONFIGURE_ARGS+= --disable-anti-virus +.endif NO_REGRESS= Yes Index: distinfo =================================================================== RCS file: /cvs/ports/mail/mimedefang/distinfo,v retrieving revision 1.2 diff -u -p -r1.2 distinfo --- distinfo 5 Apr 2007 16:20:02 -0000 1.2 +++ distinfo 9 Apr 2007 18:54:43 -0000 @@ -1,5 +1,5 @@ -MD5 (mimedefang-2.57.tar.gz) = 5Vsi3aVMSjtS4fvrkTWwzw== -RMD160 (mimedefang-2.57.tar.gz) = CBbMOXwtZVIAdgnm1byXKEId670= -SHA1 (mimedefang-2.57.tar.gz) = hSBwlwCKBqXN4cDmx2Jw73GaV2k= -SHA256 (mimedefang-2.57.tar.gz) = 3GlYCg9Zx0W8RAqdHwlEbpSVuBpoHKslyBdxJWaFNDU= -SIZE (mimedefang-2.57.tar.gz) = 316909 +MD5 (mimedefang-2.61.tar.gz) = PaLWh6QL2O0u9LHbOl6oYw== +RMD160 (mimedefang-2.61.tar.gz) = mCVl+1XwglruYxFY07as09ijs+E= +SHA1 (mimedefang-2.61.tar.gz) = +2S29/9X4JXEj84IchGx1nITqMs= +SHA256 (mimedefang-2.61.tar.gz) = mjygmy2L9AQBqr8Dygyyt4u/BYNmQjjgVo5n9FJsH7M= +SIZE (mimedefang-2.61.tar.gz) = 326722 Index: patches/patch-mimedefang_pl_in =================================================================== RCS file: patches/patch-mimedefang_pl_in diff -N patches/patch-mimedefang_pl_in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-mimedefang_pl_in 9 Apr 2007 18:54:43 -0000 @@ -0,0 +1,47 @@ +$OpenBSD$ +--- mimedefang.pl.in.orig Mon Apr 9 14:01:37 2007 ++++ mimedefang.pl.in Mon Apr 9 14:04:27 2007 +@@ -3669,7 +3669,7 @@ sub entity_contains_virus_clamav ($) { + + # Run clamscan + my($code, $category, $action) = +- run_virus_scanner($Features{'Virus:CLAMAV'} . " --mbox --stdout --disable-summary --infected $path 2>&1"); ++ run_virus_scanner($Features{'Virus:CLAMAV'} . " --stdout --disable-summary --infected $path 2>&1"); + if ($action ne 'proceed') { + return (wantarray ? ($code, $category, $action) : $code); + } +@@ -3693,7 +3693,7 @@ sub message_contains_virus_clamav () { + + # Run clamscan + my($code, $category, $action) = +- run_virus_scanner($Features{'Virus:CLAMAV'} . " -r --mbox --stdout --disable-summary --infected ./Work 2>&1"); ++ run_virus_scanner($Features{'Virus:CLAMAV'} . " -r --stdout --disable-summary --infected ./Work 2>&1"); + if ($action ne 'proceed') { + return (wantarray ? ($code, $category, $action) : $code); + } +@@ -4506,10 +4506,10 @@ sub entity_contains_virus_clamd ($;$) { + md_syslog('err', "$MsgID: Clamd returned error: $err_detail"); + # If it's a zip module failure, try falling back on clamscan. + # This is despicable, but it might work +- if ($err_detail =~ /zip module failure/i && ++ if ($err_detail =~ /(?:zip module failure|Not supported data format)/i && + $Features{'Virus:CLAMAV'}) { + my ($code, $category, $action) = +- run_virus_scanner($Features{'Virus:CLAMAV'} . " -r --unzip --mbox --stdout --disable-summary --infected $CWD/Work 2>&1"); ++ run_virus_scanner($Features{'Virus:CLAMAV'} . " -r --unzip --stdout --disable-summary --infected $CWD/Work 2>&1"); + if ($action ne 'proceed') { + return (wantarray ? ($code, $category, $action) : $code); + } +@@ -4603,10 +4603,10 @@ sub message_contains_virus_clamd (;$) { + md_syslog('err', "$MsgID: Clamd returned error: $err_detail"); + # If it's a zip module failure, try falling back on clamscan. + # This is despicable, but it might work +- if ($err_detail =~ /zip module failure/i && ++ if ($err_detail =~ /(?:zip module failure|Not supported data format)/i && + $Features{'Virus:CLAMAV'}) { + my ($code, $category, $action) = +- run_virus_scanner($Features{'Virus:CLAMAV'} . " -r --unzip --mbox --stdout --disable-summary --infected $CWD/Work 2>&1"); ++ run_virus_scanner($Features{'Virus:CLAMAV'} . " -r --unzip --stdout --disable-summary --infected $CWD/Work 2>&1"); + if ($action ne 'proceed') { + return (wantarray ? ($code, $category, $action) : $code); + } Index: pkg/MESSAGE =================================================================== RCS file: /cvs/ports/mail/mimedefang/pkg/MESSAGE,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 MESSAGE --- pkg/MESSAGE 19 Oct 2006 01:06:22 -0000 1.1.1.1 +++ pkg/MESSAGE 9 Apr 2007 18:54:43 -0000 @@ -5,6 +5,9 @@ INPUT_MAIL_FILTER(`mimedefang', \ `S=unix:/var/run/mdefang/mimedefang.socket, \ F=T, T=S:360s;R:360s;E:15m')dnl +If you with to use mimedefang with SpamAssassin, you should +install the p5-Mail-SpamAssassin package, too. + If you wish to start up mimedefang automatically during system startup, add following lines to /etc/rc.local: Index: pkg/MESSAGE-clamav =================================================================== RCS file: pkg/MESSAGE-clamav diff -N pkg/MESSAGE-clamav --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/MESSAGE-clamav 9 Apr 2007 18:54:43 -0000 @@ -0,0 +1,21 @@ +Configure clamd to use the _mdefang user by modifying the +User line in /etc/clamd.conf and the DatabaseOwner line +in /etc/freshclam.conf. +Also run: chown -R _mdefang:_mdefang /var/clamav /var/db/clamav + +To finish installation you should add following line to +your .mc files: + +INPUT_MAIL_FILTER(`mimedefang', \ + `S=unix:/var/run/mdefang/mimedefang.socket, \ + F=T, T=S:360s;R:360s;E:15m')dnl + +If you with to use mimedefang with SpamAssassin, you should +install the p5-Mail-SpamAssassin package, too. + +If you wish to start up mimedefang automatically during system +startup, add following lines to /etc/rc.local: + +if [ -f ${SYSCONFDIR}/rc.mimedefang ]; then + . ${SYSCONFDIR}/rc.mimedefang +fi Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/mail/mimedefang/pkg/PLIST,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 PLIST --- pkg/PLIST 19 Oct 2006 01:06:22 -0000 1.1.1.1 +++ pkg/PLIST 9 Apr 2007 18:54:43 -0000 @@ -1,6 +1,6 @@ @comment $OpenBSD: PLIST,v 1.1.1.1 2006/10/19 01:06:22 alek Exp $ @newgroup _mdefang:570 [EMAIL PROTECTED] _mdefang:570:_mdefang:daemon:MIMEDefang:/nonexistent:/sbin/nologin [EMAIL PROTECTED] _mdefang:570:_mdefang:daemon:MIMEDefang:/var/spool/MIMEDefang:/sbin/nologin bin/md-mx-ctrl bin/mimedefang bin/mimedefang-multiplexor @@ -15,7 +15,6 @@ bin/watch-mimedefang @man man/man8/mimedefang.pl.8 @man man/man8/watch-mimedefang.8 share/examples/mimedefang/ [EMAIL PROTECTED] ${SYSCONFDIR}/mail/ share/examples/mimedefang/mimedefang-filter @sample ${SYSCONFDIR}/mail/mimedefang-filter share/examples/mimedefang/rc.mimedefang