ports/166254: [PATCH] mail/mailscanner: Update to correct TNEF bug.
Kevin Kobb
kkobb at skylinecorp.com
Mon Mar 19 19:20:09 UTC 2012
>Number: 166254
>Category: ports
>Synopsis: [PATCH] mail/mailscanner: Update to correct TNEF bug.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Mon Mar 19 19:20:08 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator: Kevin Kobb
>Release: FreeBSD 9.0-RELEASE amd64
>Organization:
>Environment:
FreeBSD mail.skylinecorp.com 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46:30 UTC 2012 root at farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
Recent MailScanner update introduce a bug in the TNEF.pm module that made unpacking MS TNEF attachments produce errors. This is due the process used to create the temp directories.
>How-To-Repeat:
Install the MailScanner port and send a message with a MS TNEF attachment.
>Fix:
Apply the attached patch.
Patch attached with submission follows:
diff -urN mailscanner.orig/Makefile mailscanner/Makefile
--- mailscanner.orig/Makefile 2012-03-14 14:38:56.000000000 -0400
+++ mailscanner/Makefile 2012-03-19 14:34:30.000000000 -0400
@@ -7,6 +7,7 @@
PORTNAME= MailScanner
PORTVERSION= 4.84.5
+PORTREVISION= 1
CATEGORIES= mail
MASTER_SITES= http://www.mailscanner.info/files/4/tar/
DISTNAME= ${PORTNAME}-install-${PORTVERSION}-${PATCHLEVEL}
@@ -51,10 +52,11 @@
USE_PERL5= yes
WRKSRC= ${WRKDIR}/${PORTNAME}-install-${PORTVERSION}
-SUB_FILES= pkg-message pkg-install pkg-deinstall
+SUB_FILES= MailScanner.8 pkg-message pkg-install pkg-deinstall
SUB_LIST= DATADIR=${DATADIR} \
PERL=${PERL} \
PKGVERSION=${PKGVERSION} \
+ PORTVERSION=${PORTVERSION} \
ETC_FILES="${ETC_FILES}" \
MCP_FILES="${MCP_FILES}"
@@ -272,7 +274,7 @@
.else
@${ECHO_MSG} -n ">> Installing manpage..."
.endif
- @cd ${FILESDIR} && \
+ @cd ${WRKDIR} && \
${INSTALL_MAN} ${MAN8} ${MAN5PREFIX}/man/man8
@${ECHO_MSG} " [DONE]"
diff -urN mailscanner.orig/files/CHANGES.port mailscanner/files/CHANGES.port
--- mailscanner.orig/files/CHANGES.port 2012-03-10 05:30:07.000000000 -0500
+++ mailscanner/files/CHANGES.port 2012-03-19 14:34:30.000000000 -0400
@@ -1,3 +1,9 @@
+Version 4.84.5_1
+================
+- Added patch for TNEF.pm bug
+- Fixed creation of mailscanner.cf symlink
+- Minor doc updates
+
Version 4.84.5
==============
- Upgrade to 4.84.5
diff -urN mailscanner.orig/files/MailScanner.8 mailscanner/files/MailScanner.8
--- mailscanner.orig/files/MailScanner.8 2006-08-11 16:10:30.000000000 -0400
+++ mailscanner/files/MailScanner.8 1969-12-31 19:00:00.000000000 -0500
@@ -1,12 +0,0 @@
-.TH "MailScanner" "8" "4.52.2" "Julian Field" "Mail"
-.SH "NAME"
-.LP
-MailScanner \- Virus/Spam Scanner for Sendmail, Exim and Postfix
-.SH "SEE ALSO"
-.LP
-Please see http://www.mailscanner.info for current documentation. All current configuration options can be found at
-.br
-
-.br
-http://www.mailscanner.info/MailScanner.conf.index.html
-
diff -urN mailscanner.orig/files/MailScanner.8.in mailscanner/files/MailScanner.8.in
--- mailscanner.orig/files/MailScanner.8.in 1969-12-31 19:00:00.000000000 -0500
+++ mailscanner/files/MailScanner.8.in 2012-03-19 14:34:30.000000000 -0400
@@ -0,0 +1,12 @@
+.TH "MailScanner" "8" "%%PORTVERSION%%" "Julian Field" "Mail"
+.SH "NAME"
+.LP
+MailScanner \- Virus/Spam Scanner for Sendmail, Exim and Postfix
+.SH "SEE ALSO"
+.LP
+Please see http://www.mailscanner.info for current documentation. All current configuration options can be found at
+.br
+
+.br
+http://www.mailscanner.info/MailScanner.conf.index.html
+
diff -urN mailscanner.orig/files/README.FreeBSD.port mailscanner/files/README.FreeBSD.port
--- mailscanner.orig/files/README.FreeBSD.port 2006-02-16 11:34:56.000000000 -0500
+++ mailscanner/files/README.FreeBSD.port 2012-03-19 14:35:24.000000000 -0400
@@ -1,7 +1,7 @@
The MailScanner port is using the original MailScanner tarball from
-www.mailscanner.info. Unfortunatly the tarball consists of MailScanner
-and perl modules etc. MailScanner depends on. The port is not using
-Julians install.sh or the provided modules. All modules that MailScanner
+www.mailscanner.info. Unfortunately the tarball consists of MailScanner
+and perl modules etc, MailScanner depends on. The port is not using
+Julian's install.sh or the provided modules. All modules that MailScanner
depends on are installed via ports as well.
In order to make the installation FreeBSD compliant the port installs files
@@ -17,10 +17,10 @@
The port installs two start/stop scripts in /usr/local/etc/rc.d:
-mailscanner.sh
-mta.sh
+mailscanner
+mta
-My suggestion is to use mta.sh instead of the usual FreeBSD MTA startup
+My suggestion is to use mta instead of the usual FreeBSD MTA startup
process. This of course means that you will have to disable MTA startup
in rc.conf completely. Put this in your rc.conf:
@@ -36,11 +36,4 @@
port will try to update all your languages conf files.
-If you have suggestions for this port please let me know and drop me an e-mail at
-
-j.koopmann at seceidos.de
-
-
-Thanks,
- Jan-Peter Koopmann
-
+If you have suggestions for this port please contact the port maintainer.
diff -urN mailscanner.orig/files/mailscanner.in mailscanner/files/mailscanner.in
--- mailscanner.orig/files/mailscanner.in 2012-01-15 15:35:29.000000000 -0500
+++ mailscanner/files/mailscanner.in 2012-03-19 14:34:30.000000000 -0400
@@ -1,4 +1,4 @@
-#! /bin/sh
+#!/bin/sh
# PROVIDE: mailscanner
# REQUIRE: mta
diff -urN mailscanner.orig/files/mta.in mailscanner/files/mta.in
--- mailscanner.orig/files/mta.in 2012-01-15 15:35:29.000000000 -0500
+++ mailscanner/files/mta.in 2012-03-19 14:34:30.000000000 -0400
@@ -23,7 +23,7 @@
# to "/var/run/sendmail.pid" or "/var/run/exim.pid"
#
#
-# ATTENTION: All of the above entries are necessary in order for mta.sh to work correctly!
+# ATTENTION: All of the above entries are necessary in order for mta to work correctly!
#
#
diff -urN mailscanner.orig/files/patch-lib__MailScanner__TNEF.pm mailscanner/files/patch-lib__MailScanner__TNEF.pm
--- mailscanner.orig/files/patch-lib__MailScanner__TNEF.pm 1969-12-31 19:00:00.000000000 -0500
+++ mailscanner/files/patch-lib__MailScanner__TNEF.pm 2012-03-19 14:34:30.000000000 -0400
@@ -0,0 +1,20 @@
+--- ./lib/MailScanner/TNEF.pm.orig 2011-08-20 08:32:02.000000000 -0400
++++ ./lib/MailScanner/TNEF.pm 2012-03-15 11:28:31.000000000 -0400
+@@ -229,15 +229,14 @@
+
+ # Create the subdir to unpack it into
+ #my $unpackdir = "tnef.$$";
+- my ($tmpfh, $unpackdir) = tempfile("tnefXXXXXX", TMPDIR => $dir, UNLINK => 0);
+- $dir =~ s,^.*/,,;
++ my $unpackdir = tempdir("tnefXXXXXX");
+ $unpackdir = $message->MakeNameSafe($unpackdir, $dir);
+ unless (mkdir "$dir/$unpackdir", 0777) {
+ MailScanner::Log::WarnLog("Trying to unpack %s in message %s, could not create subdirectory %s, failed to unpack TNEF message", $tnefname, $message->{id},
+ "$dir/$unpackdir");
+ return 0;
+ }
+- chmod 0700, "$dir/$unpackdir";
++ chmod 0770, "$dir/$unpackdir";
+
+ my $cmd = MailScanner::Config::Value('tnefexpander') .
+ " -f $dir/$tnefname -C $dir/$unpackdir --overwrite";
diff -urN mailscanner.orig/files/pkg-install.in mailscanner/files/pkg-install.in
--- mailscanner.orig/files/pkg-install.in 2011-06-18 12:35:08.000000000 -0400
+++ mailscanner/files/pkg-install.in 2012-03-19 14:34:30.000000000 -0400
@@ -102,7 +102,7 @@
case $2 in
POST-INSTALL)
- [ ! -z "${WITHOUT_SPAMASSASSIN_SYMLINK}" ] \
+ [ -z "${WITHOUT_SPAMASSASSIN_SYMLINK}" ] \
&& [ ! -r ${PKG_PREFIX}/etc/mail/spamassassin/mailscanner.cf ] \
&& ${LN} -s ${PKG_PREFIX}/etc/MailScanner/spam.assassin.prefs.conf \
${PKG_PREFIX}/etc/mail/spamassassin/mailscanner.cf
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list