diff options
author | Renato Botelho <garga@FreeBSD.org> | 2007-10-05 14:19:52 +0000 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2007-10-05 14:19:52 +0000 |
commit | 8278734711780ff1f08e2a7f4a8ef7b4c170ceca (patch) | |
tree | 11858e845ceedd3114c10b0b35f0147ba9431a60 /mail/qmail-scanner | |
parent | c63adb00c63233441b70705810c74e48bc20e16d (diff) |
Notes
Diffstat (limited to 'mail/qmail-scanner')
-rw-r--r-- | mail/qmail-scanner/Makefile | 75 | ||||
-rw-r--r-- | mail/qmail-scanner/files/pkg-install.in | 10 | ||||
-rw-r--r-- | mail/qmail-scanner/files/pkg-message.in | 31 |
3 files changed, 62 insertions, 54 deletions
diff --git a/mail/qmail-scanner/Makefile b/mail/qmail-scanner/Makefile index 3af812a50a9d..da0f9d7d249e 100644 --- a/mail/qmail-scanner/Makefile +++ b/mail/qmail-scanner/Makefile @@ -7,7 +7,7 @@ PORTNAME= qmail-scanner PORTVERSION= 2.01 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= mail security MASTER_SITES= SF EXTRACT_SUFX= .tgz @@ -15,24 +15,38 @@ EXTRACT_SUFX= .tgz MAINTAINER= lippe@freebsdbrasil.com.br COMMENT= Content/Anti-virus Scanner for qmail -MANUAL_PACKAGE_BUILD= Requires qmail built with non-standard setting - +RUN_DEPENDS+= reformime:${PORTSDIR}/mail/maildrop \ + unzip:${PORTSDIR}/archivers/unzip \ + ${SITE_PERL}/${PERL_ARCH}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes \ + ${SITE_PERL}/${PERL_ARCH}/MIME/Base64.pm:${PORTSDIR}/converters/p5-MIME-Base64 BUILD_DEPENDS+= reformime:${PORTSDIR}/mail/maildrop \ + unzip:${PORTSDIR}/archivers/unzip \ ${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 -NO_BUILD= yes - USE_QMAIL= yes -CONFLICTS= qmail-scanner-1.* +SPOOLDIR?= /var/spool/qscand +PLIST_SUB= SPOOLDIR=${SPOOLDIR} + +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" \ + --no-QQ-check \ + --batch QS_USER?= qscand QS_ADMIN?= postmaster -QS_ID?= 85 +QS_ID?= 98 DOCS= logging_first_80_chars.eml patch_for_nod32_single_user.eml \ reformime-test.eml spamc-nasty.eml spamc-nice.eml vpopmail-issues.eml @@ -42,30 +56,19 @@ CONTRIB= mrtg-qmail-scanner.cfg check_AV_daemons logrotate.qmail-scanner \ 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 + NORMALIZE "Decode encoded headers per MIME Base64" off -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> +# Options .if defined(WITH_TNEF) BUILD_DEPENDS+= ${LOCALBASE}/bin/tnef:${PORTSDIR}/converters/tnef .endif @@ -82,10 +85,6 @@ CONFIGURE_ARGS+= --redundant no CONFIGURE_ARGS+= --normalize no .endif -.if defined(WITH_UNZIP) -CONFIGURE_ARGS+= --unzip yes -.endif - .if !defined(QS_USER) CONFIGURE_ARGS+= --qs-user "${QS_USER}" .endif @@ -216,13 +215,13 @@ pre-configure: @${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-build: + @${REINPLACE_CMD} -E 's,^#!.*perl(.*)$$,#!${PERL}\1,' ${WRKSRC}/qmail-scanner-queue.pl + do-install: .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR}/contrib @@ -234,17 +233,13 @@ do-install: . 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} "" diff --git a/mail/qmail-scanner/files/pkg-install.in b/mail/qmail-scanner/files/pkg-install.in index 9b69e9855472..6d0083fdcc34 100644 --- a/mail/qmail-scanner/files/pkg-install.in +++ b/mail/qmail-scanner/files/pkg-install.in @@ -1,7 +1,5 @@ #!/bin/sh -PREFIX=%%PREFIX%% - PW="/usr/sbin/pw" CHOWN="/usr/sbin/chown" CHMOD="/bin/chmod" @@ -36,8 +34,12 @@ POST-INSTALL) # 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} diff --git a/mail/qmail-scanner/files/pkg-message.in b/mail/qmail-scanner/files/pkg-message.in index 2f3f1f42065c..5df6cd08a2cf 100644 --- a/mail/qmail-scanner/files/pkg-message.in +++ b/mail/qmail-scanner/files/pkg-message.in @@ -2,25 +2,36 @@ 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: +ATTENTION!!! - You just need to add for your tcpserver file (generally called +For qmail-scanner work correctly, be sure to have QMAILQUEUE patch applied on +your qmail. + +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; + +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 + |