ports/116312: [PATCH] mail/qmail-scanner
Felippe de Meirelles Motta
lippe at freebsdbrasil.com.br
Wed Sep 12 17:20:01 UTC 2007
>Number: 116312
>Category: ports
>Synopsis: [PATCH] mail/qmail-scanner
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Wed Sep 12 17:20:01 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator: Felippe de Meirelles Motta
>Release: FreeBSD 6.2-STABLE i386
>Organization:
FreeBSD Brasil LTDA
>Environment:
FreeBSD dev.bh.freebsdbrasil.com.br 6.2-STABLE FreeBSD 6.2-STABLE #0: Mon Jun 25 13:46:23 BRT 2007 lippe at dev.bh.freebsdbrasil.com.br:/usr/obj/usr/src/sys/GENERIC i386
>Description:
- The script configure wasn't being executed correctly, therefore, script that would have to be generated (qmail-scanner-queue.pl), this correct one for execution of the application.
Reported by William Olson <wolson at gmail.com>, thanks! :)
>How-To-Repeat:
>Fix:
Patch attached with submission follows:
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/mail/qmail-scanner/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- Makefile 9 Sep 2007 07:49:32 -0000 1.17
+++ Makefile 12 Sep 2007 16:42:35 -0000
@@ -17,18 +17,30 @@
MANUAL_PACKAGE_BUILD= Requires qmail built with non-standard setting
+RUN_DEPENDS+= ${BUILD_DEPENDS}
BUILD_DEPENDS+= reformime:${PORTSDIR}/mail/maildrop \
${SITE_PERL}/${PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes \
${SITE_PERL}/${PERL_ARCH}/MIME/Base64.pm:${PORTSDIR}/converters/p5-MIME-Base64
-QMAIL_QUEUE= ${QMAIL_PREFIX}/bin/qmail-queue
+CONFLICTS= qmail-scanner-1.*
USE_PERL5= yes
+USE_QMAIL= yes
NO_BUILD= yes
-USE_QMAIL= yes
+SPOOLDIR?= /var/spool/qscand
+PLIST_SUB= SPOOLDIR=${SPOOLDIR}
-CONFLICTS= qmail-scanner-1.*
+QMAIL_QUEUE= ${QMAIL_PREFIX}/bin/qmail-queue
+
+HAS_CONFIGURE= yes
+CONFIGURE_ARGS+= \
+ --qmaildir "${QMAIL_PREFIX}" \
+ --spooldir "${SPOOLDIR}" \
+ --bindir "${PREFIX}/bin" \
+ --qmail-queue-binary "${QMAIL_QUEUE}" \
+ --mime-unpacker "reformime" \
+ --batch
QS_USER?= qscand
QS_ADMIN?= postmaster
@@ -42,30 +54,20 @@
test-sophie.pl test-trophie.pl test_installation.sh test_password.zip \
qmail-scanner-queue.c
-SPOOLDIR?= /var/spool/qscand
-PLIST_SUB= SPOOLDIR=${SPOOLDIR}
-
OPTIONS= TNEF "Mark Simpson's Patch (Recommended)" on \
FIX_MIME "Fix broken MIME messages" off \
REDUNDANT "Scan attachments and body mails" on \
NORMALIZE "Decode encoded headers per MIME Base64" off \
UNZIP "Force UNZIP all zip files" off
-HAS_CONFIGURE= yes
-CONFIGURE_ARGS+=--qmaildir "${QMAIL_PREFIX}" \
- --spooldir "${SPOOLDIR}" \
- --bindir "${PREFIX}/bin" \
- --qmail-queue-binary "${QMAIL_QUEUE}" \
- --mime-unpacker "reformime" \
- --batch
-
-SUB_FILES= pkg-message pkg-install
-SUB_LIST= SPOOLDIR="${SPOOLDIR}" \
- QS_USER=${QS_USER} \
- QS_ID=${QS_ID}
+SUB_FILES= pkg-install pkg-message
+SUB_LIST+= QS_USER=${QS_USER} \
+ QS_ID=${QS_ID} \
+ SPOOLDIR=${SPOOLDIR}
-.include <bsd.port.pre.mk>
+PKGINSTALL?= ${WRKDIR}/pkg-install
+# Options
.if defined(WITH_TNEF)
BUILD_DEPENDS+= ${LOCALBASE}/bin/tnef:${PORTSDIR}/converters/tnef
.endif
@@ -216,11 +218,8 @@
@${ECHO_MSG} " NOTE: Numbers over 100 cause Q-S to not cleanup working files"
@${ECHO_MSG} " (Default: yes, Options: yes|no|number)"
@${ECHO_MSG} ""
-
-do-configure:
@${SED} -e 's,%%SPOOLDIR%%,${SPOOLDIR},g; s,%%QS_USER%%,${QS_USER},g; \
- s,%%QS_ID%%,${QS_ID},g; s,%%PREFIX%%,${PREFIX},g' \
- ${FILESDIR}/pkg-install.in > ${WRKDIR}/pkg-install
+ s,%%QS_ID%%,${QS_ID},g' ${FILESDIR}/pkg-install.in > ${PKGINSTALL}
@${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
do-install:
@@ -234,21 +233,17 @@
. endfor
.endif
@${MKDIR} ${SPOOLDIR}
+ @${INSTALL_SCRIPT} ${WRKSRC}/qmail-scanner-queue.pl ${PREFIX}/bin
@${INSTALL_DATA} ${WRKSRC}/quarantine-events.txt ${SPOOLDIR}/quarantine-events.txt.sample
- @${INSTALL_SCRIPT} ${WRKSRC}/qmail-scanner-queue.template ${PREFIX}/bin/qmail-scanner-queue.pl
- @${ECHO_MSG} ""
- @${CAT} ${PKGMESSAGE}
- @${ECHO_MSG} ""
-
-post-install:
@${SETENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+ @${CAT} ${PKGMESSAGE}
post-deinstall:
- @${ECHO_MSG} ""
+ @${ECHO_MSG}
@${ECHO_MSG} "If you're not updating this port, you can delete directory '${SPOOLDIR}'."
@${ECHO_MSG} ""
test:
@${WRKSRC}/contrib/test_installation.sh -doit
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
Index: files/pkg-install.in
===================================================================
RCS file: /home/ncvs/ports/mail/qmail-scanner/files/pkg-install.in,v
retrieving revision 1.2
diff -u -r1.2 pkg-install.in
--- files/pkg-install.in 9 Sep 2007 07:49:33 -0000 1.2
+++ files/pkg-install.in 12 Sep 2007 16:42:35 -0000
@@ -1,7 +1,5 @@
#!/bin/sh
-PREFIX=%%PREFIX%%
-
PW="/usr/sbin/pw"
CHOWN="/usr/sbin/chown"
CHMOD="/bin/chmod"
@@ -36,8 +34,12 @@
# Mod and owner
${CHOWN} -R ${QS_USER}:${QS_USER} ${SPOOLDIR}
- ${CHOWN} ${QS_USER}:${QS_USER} ${PREFIX}/bin/qmail-scanner-queue.pl
- ${CHMOD} 4755 ${PREFIX}/bin/qmail-scanner-queue.pl
+ ${CHOWN} ${QS_USER}:${QS_USER} ${PKG_PREFIX}/bin/qmail-scanner-queue.pl
+ ${CHMOD} 4755 ${PKG_PREFIX}/bin/qmail-scanner-queue.pl
+
+ # Initialize
+ ${PKG_PREFIX}/bin/qmail-scanner-queue.pl -z
+ ${PKG_PREFIX}/bin/qmail-scanner-queue.pl -g
# Mod and owner (final)
${CHOWN} -R ${QS_USER}:${QS_USER} ${SPOOLDIR}
Index: files/pkg-message.in
===================================================================
RCS file: /home/ncvs/ports/mail/qmail-scanner/files/pkg-message.in,v
retrieving revision 1.2
diff -u -r1.2 pkg-message.in
--- files/pkg-message.in 9 Sep 2007 07:49:33 -0000 1.2
+++ files/pkg-message.in 12 Sep 2007 16:42:35 -0000
@@ -2,25 +2,31 @@
Congratulations! Qmail-Scanner is now installed!
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- - Please, configure correctly your anti-virus and anti-spam;
- - You HAVE to reinstall this port each time you add or remo-
-ve an Anti-Virus or Anti-Spam;
- - Now configure the environment variable to use qmail-scanner:
+Please, configure correctly your anti-virus and anti-spam. You
+HAVE to reinstall this port each time you add or remove an
+Anti-Virus or Anti-Spam;
- You just need to add for your tcpserver file (generally called
+Now configure the environment variable to use qmail-scanner:
+
+You just need to add for your tcpserver file (generally called
as: tcp.smtp):
- QMAILQUEUE="%%PREFIX%%/bin/qmail-scanner-queue.pl"
- Or create an new file in /service/smtpd/env, with the following
+QMAILQUEUE="%%PREFIX%%/bin/qmail-scanner-queue.pl"
+
+Or create an new file in /service/smtpd/env, with the following
content and called as "QMAILQUEUE":
- %%PREFIX%%/bin/qmail-scanner-queue.pl
+
+%%PREFIX%%/bin/qmail-scanner-queue.pl
NOTE: always you change anything in your environment dir, you just
need to restart your smtpd, for it use: "svc -k /service/smtpd".
You can test your installation by running 'make test' in port dir.
-Please, run the following commands:
+Remember to rename quarantine-events.txt.sample in /var/spool/qscand
+and then run "qmail-scanner-queue.pl -g" to generate DB version.
+
+Please log into an unpriviledged account and run
-%%PREFIX%%/bin/qmail-scanner-queue.pl -z
%%PREFIX%%/bin/qmail-scanner-queue.pl -g
+
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list