diff options
-rw-r--r-- | mail/mailscanner/DESCR | 22 | ||||
-rw-r--r-- | mail/mailscanner/MESSAGE | 12 | ||||
-rw-r--r-- | mail/mailscanner/Makefile | 144 | ||||
-rw-r--r-- | mail/mailscanner/PLIST | 2 | ||||
-rw-r--r-- | mail/mailscanner/distinfo | 4 | ||||
-rw-r--r-- | mail/mailscanner/files/mailscanner.sh | 17 |
6 files changed, 201 insertions, 0 deletions
diff --git a/mail/mailscanner/DESCR b/mail/mailscanner/DESCR new file mode 100644 index 00000000000..39038a926d5 --- /dev/null +++ b/mail/mailscanner/DESCR @@ -0,0 +1,22 @@ +MailScanner is a complete e-mail security system designed for use on +e-mail gateways. It protects against viruses, and detects attacks against +e-mail client packages (such as Outlook, Outlook Express, Eudora). It +can also detect almost all unsolicited commercial e-mail (spam) passing +through it and respond to all incidents in a wide variety of ways. + +Not only can it scan for known viruses, but it can also protect against +unknown viruses hidden inside e-mail attachments by refusing entry to +attachments whose filenames match any given pattern. This can include +generic patterns that trap filenames attempting to hide the true filename +extension (e.g. ".txt.vbs"). + +It is superior to many commercial packages in its ability to handle +attacks against itself, such as Denial Of Service attacks caused by +messages containing the "Zip of Death". It is easy to install into an +existing e-mail gateway, requiring very little knowledge of sendmail +and no change to an existing sendmail configuration. + +MailScanner itself is entirely open source, but it uses widely known +commercial virus scanning packages at its core. The other software it +uses is all high quality open source software, leading to a system that +can be trusted for performance and reliability. diff --git a/mail/mailscanner/MESSAGE b/mail/mailscanner/MESSAGE new file mode 100644 index 00000000000..d285059c16e --- /dev/null +++ b/mail/mailscanner/MESSAGE @@ -0,0 +1,12 @@ +=========================================================================== +$NetBSD: MESSAGE,v 1.1.1.1 2004/09/25 00:33:19 grant Exp $ + +See ${PREFIX}/share/doc/MailScanner/README and the MailScanner(8) and +MailScanner.conf(5) man pages for further instructions. + +You will need to edit at least the following config file before MailScanner +will work correctly: + + ${PKG_SYSCONFDIR}/MailScanner.conf + +=========================================================================== diff --git a/mail/mailscanner/Makefile b/mail/mailscanner/Makefile new file mode 100644 index 00000000000..bc730f21ca3 --- /dev/null +++ b/mail/mailscanner/Makefile @@ -0,0 +1,144 @@ +# $NetBSD: Makefile,v 1.1.1.1 2004/09/25 00:33:19 grant Exp $ +# + +DISTNAME= MailScanner-4.30.3-2 +PKGNAME= mailscanner-4.30.3.2 +CATEGORIES= mail +MASTER_SITES= http://www.sng.ecs.soton.ac.uk/mailscanner/files/4/tar/ + +MAINTAINER= grant@NetBSD.org +HOMEPAGE= http://www.mailscanner.info/ +COMMENT= Powerful spam/virus filter with many options + +WRKSRC= ${WRKDIR}/MailScanner-4.30.3 +USE_PKGINSTALL= YES + +PKG_SYSCONFSUBDIR= MailScanner + +DEPENDS+= p5-Archive-Zip-[0-9]*:../../archivers/p5-Archive-Zip +DEPENDS+= p5-Convert-BinHex-[0-9]*:../../wip/p5-Convert-BinHex +DEPENDS+= p5-Net-CIDR>=0.09:../../devel/p5-Net-CIDR +DEPENDS+= p5-MIME-tools>=0:../../mail/p5-MIME-tools +DEPENDS+= tnef>=1.0:../../mail/tnef + +NO_BUILD= YES +USE_PERL5= YES +REPLACE_PERL= bin/MailScanner + +DOCSDIR= ${LOCALBASE}/share/doc/MailScanner +EGDIR= ${LOCALBASE}/share/examples/MailScanner +LIBDIR= ${LOCALBASE}/lib/MailScanner +LIBEXECDIR= ${LOCALBASE}/libexec/MailScanner + +OWN_DIRS= ${PKG_SYSCONFDIR}/CustomFunctions +OWN_DIRS+= ${PKG_SYSCONFDIR}/rules + +PLIST_SUBST+= DOCSDIR=${DOCSDIR} +PLIST_SUBST+= EGDIR=${EGDIR} +PLIST_SUBST+= LIBDIR=${LIBDIR} +PLIST_SUBST+= LIBEXECDIR=${LIBEXECDIR} + +PLIST_SRC= ${WRKDIR}/PLIST_DYNAMIC + +MS_CONFIG_FILES= filename.rules.conf \ + filetype.rules.conf spam.assassin.prefs.conf \ + spam.lists.conf virus.scanners.conf \ + rules/bounce.rules rules/spam.whitelist.rules + +CONF_FILES+= ${EGDIR}/MailScanner.conf ${PKG_SYSCONFDIR}/MailScanner.conf +.for _f_ in ${MS_CONFIG_FILES} +CONF_FILES+= ${EGDIR}/${_f_} ${PKG_SYSCONFDIR}/${_f_} +.endfor + +RCD_SCRIPTS= mailscanner + +SUBST_CLASSES+= paths sendmail systemdefs + +SUBST_STAGE.paths= post-patch +SUBST_FILES.paths= bin/MailScanner etc/MailScanner.conf +SUBST_FILES.paths+= etc/virus.scanners.conf bin/update_virus_scanners +SUBST_FILES.paths+= lib/MailScanner/ConfigDefs.pl + +SUBST_SED.paths= -e s,/opt/MailScanner/lib/MailScanner/CustomFunctions,${PKG_SYSCONFDIR}/CustomFunctions,g +SUBST_SED.paths+= -e s,/opt/MailScanner/lib,${LIBDIR},g +SUBST_SED.paths+= -e s,/opt/MailScanner/etc/reports,${EGDIR}/reports,g +SUBST_SED.paths+= -e s,/opt/MailScanner/etc,${PKG_SYSCONFDIR},g +SUBST_SED.paths+= -e s,/opt/MailScanner/var/MailScanner.pid,/var/run/MailScanner.pid,g +SUBST_SED.paths+= -e s,/opt/MailScanner/bin,${PREFIX}/bin,g + +.include "../../mk/bsd.prefs.mk" + +# XXX this could use some improvement +.if ${OPSYS} == "NetBSD" +SUBST_STAGE.sendmail= post-patch +SUBST_FILES.sendmail= bin/MailScanner etc/MailScanner.conf +SUBST_FILES.sendmail+= etc/virus.scanners.conf bin/update_virus_scanners +SUBST_FILES.sendmail+= lib/MailScanner/ConfigDefs.pl +SUBST_SED.sendmail= -e s,/usr/lib/sendmail,/usr/sbin/mailwrapper,g +.endif + +SUBST_STAGE.systemdefs= post-patch +SUBST_FILES.systemdefs= lib/MailScanner/SystemDefs.pm +SUBST_SED.systemdefs= -e s,/bin/cat,${CAT},g +SUBST_SED.systemdefs= -e s,/bin/cp,${CP},g +SUBST_SED.systemdefs= -e s,/bin/rm,${RM},g + +# we can't use sed from pkgsrc as it won't be registered as a +# dependency. XXX tools.mk needs a way to tell us about this dependency. +.if empty(SED:M${LOCALBASE}*) +SUBST_SED.systemdefs= -e s,/bin/sed,${SED},g +.endif + +# get rid of CVS backup files +post-extract: + cd ${WRKSRC} && ${RM} -f */.#* + +do-install: + ${INSTALL_DATA_DIR} ${EGDIR} + ${INSTALL_DATA_DIR} ${EGDIR}/rules + ${INSTALL_SCRIPT} ${WRKSRC}/bin/MailScanner ${PREFIX}/bin + + ${INSTALL_LIB_DIR} ${LIBEXECDIR} + ${INSTALL_SCRIPT} ${WRKSRC}/bin/update_virus_scanners ${LIBEXECDIR} + cd ${WRKSRC}/lib && ${FIND} . -name "*-autoupdate" -exec ${INSTALL_SCRIPT} '{}' ${LIBEXECDIR} \; + cd ${WRKSRC}/lib && ${FIND} . -name "*-wrapper" -exec ${INSTALL_SCRIPT} '{}' ${LIBEXECDIR} \; + + ${INSTALL_DATA} ${WRKSRC}/etc/MailScanner.conf ${EGDIR}/MailScanner.conf +.for _f_ in ${MS_CONFIG_FILES} + ${INSTALL_DATA} ${WRKSRC}/etc/${_f_} ${EGDIR} +.endfor + cd ${WRKSRC}/etc/rules && ${INSTALL_DATA} \ + EXAMPLES README spam.whitelist.rules bounce.rules \ + ${EGDIR}/rules + cd ${WRKSRC}/etc && ${FIND} reports -type d -exec ${INSTALL_DATA_DIR} ${EGDIR}/'{}' \; + cd ${WRKSRC}/etc && ${FIND} reports -type f ! -name "*.orig" -exec ${INSTALL_DATA} '{}' ${EGDIR}/'{}' \; + + ${INSTALL_LIB_DIR} ${LIBDIR} + ${INSTALL_LIB_DIR} ${LIBDIR}/MailScanner + ${INSTALL_SCRIPT} ${WRKSRC}/lib/MailScanner.pm ${LIBDIR} + cd ${WRKSRC}/lib/MailScanner && ${FIND} . -name "*.pm" -exec ${INSTALL_DATA} '{}' ${LIBDIR}/MailScanner \; + cd ${WRKSRC}/lib/MailScanner && ${FIND} . -name "*.pl" -exec ${INSTALL_DATA} '{}' ${LIBDIR}/MailScanner \; + + ${INSTALL_DATA_DIR} ${DOCSDIR} + cd ${WRKSRC}/docs && ${FIND} * -type d -exec ${INSTALL_DATA_DIR} ${DOCSDIR}'/{}' \; + cd ${WRKSRC}/docs && ${FIND} * -type f -exec ${INSTALL_DATA} '{}' ${DOCSDIR} \; + cd ${WRKSRC}/docs/man && ${INSTALL_MAN} MailScanner.conf.5 ${PREFIX}/man/man5 + cd ${WRKSRC}/docs/man && ${INSTALL_MAN} MailScanner.8 ${PREFIX}/man/man8 + +post-install: + ${CP} -f ${PKGDIR}/PLIST ${PLIST_SRC} + ${ECHO} bin/MailScanner >> ${PLIST_SRC} + ${ECHO} man/man5/MailScanner.conf.5 >> ${PLIST_SRC} + ${ECHO} man/man8/MailScanner.8 >> ${PLIST_SRC} +.for _dir_ in ${DOCSDIR} ${EGDIR} ${LIBDIR} ${LIBEXECDIR} + ${FIND} ${_dir_} \( -type f -o -type l \) -print \ + | ${SORT} | ${SED} -e "s,${PREFIX}/,,g" \ + >> ${PLIST_SRC} +.endfor +.for _dir_ in ${DOCSDIR} ${EGDIR} ${LIBDIR} ${LIBEXECDIR} + ${FIND} ${_dir_} -type d -print \ + | ${SORT} -r | ${SED} -e "s,${PREFIX}/,@dirrm ,g" \ + >> ${PLIST_SRC} +.endfor + +.include "../../mk/bsd.pkg.mk" diff --git a/mail/mailscanner/PLIST b/mail/mailscanner/PLIST new file mode 100644 index 00000000000..d065dee1d62 --- /dev/null +++ b/mail/mailscanner/PLIST @@ -0,0 +1,2 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2004/09/25 00:33:19 grant Exp $ +@comment this PLIST automatically generated diff --git a/mail/mailscanner/distinfo b/mail/mailscanner/distinfo new file mode 100644 index 00000000000..07b9fd79680 --- /dev/null +++ b/mail/mailscanner/distinfo @@ -0,0 +1,4 @@ +$NetBSD: distinfo,v 1.1.1.1 2004/09/25 00:33:19 grant Exp $ + +SHA1 (MailScanner-4.30.3-2.tar.gz) = ef9503dc57ec6d6f97a7333fce2b3e283d972498 +Size (MailScanner-4.30.3-2.tar.gz) = 996850 bytes diff --git a/mail/mailscanner/files/mailscanner.sh b/mail/mailscanner/files/mailscanner.sh new file mode 100644 index 00000000000..044f5730ef1 --- /dev/null +++ b/mail/mailscanner/files/mailscanner.sh @@ -0,0 +1,17 @@ +#!@RCD_SCRIPTS_SHELL@ +# +# $NetBSD: mailscanner.sh,v 1.1.1.1 2004/09/25 00:33:19 grant Exp $ +# +# PROVIDE: mailscanner +# REQUIRE: LOGIN + +. /etc/rc.subr + +name="MailScanner" +rcvar="mailscanner" +start_cmd="@PREFIX@/bin/${name}" +pidfile="/var/run/${name}.pid" +required_files="@PKG_SYSCONFDIR@/${name}.conf" + +load_rc_config $name +run_rc_command "$1" |