ports/156296: [PATCH] mail/mailman: make private archives searchable with namazu2

TAKATSU Tomonari tota at FreeBSD.org
Sat Apr 9 13:00:26 UTC 2011


>Number:         156296
>Category:       ports
>Synopsis:       [PATCH] mail/mailman: make private archives searchable with namazu2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Apr 09 13:00:21 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     TAKATSU Tomonari
>Release:        FreeBSD 8.2-RELEASE amd64
>Organization:
none (private)
>Environment:
System: FreeBSD photon.local.lan 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011
>Description:
I'd like to add NAMAZU2 to OPTIONS to make private archives searchable
with namazu2.
I modified a patch which is shown in
http://www.python.jp/pipermail/mailman-users-jp/2004-August/001008.html
to be secure to restrict namazu.cgi called by popen.

Added file(s):
- files/extra-patch-Mailman-Cgi-private.py
- files/pkg-message-namazu2.in

Port maintainer (wxs at FreeBSD.org) is cc'd.

Generated with FreeBSD Port Tools 0.99
>How-To-Repeat:
>Fix:

--- mailman-2.1.14_2.patch begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/mail/mailman/Makefile,v
retrieving revision 1.85
diff -u -u -r1.85 Makefile
--- Makefile	29 Mar 2011 02:38:16 -0000	1.85
+++ Makefile	9 Apr 2011 12:17:37 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	mailman
 DISTVERSION=	2.1.14
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES?=	mail
 MASTER_SITES=	${MASTER_SITE_GNU} \
 		SF/${PORTNAME}/Mailman%202.1%20%28stable%29/${PORTVERSION}
@@ -24,7 +24,8 @@
 		POSTFIX "for use with postfix" off \
 		COURIER "for use with courier" off \
 		CHINESE "support for Chinese mailing lists" off \
-		HTDIG "htdig integration patches" off
+		HTDIG "htdig integration patches" off \
+		NAMAZU2 "make private archives searchable with namazu2" off
 
 HAS_CONFIGURE=	yes
 USE_PYTHON=	yes
@@ -124,6 +125,16 @@
 PLIST_SUB+=	SUB_HTDIG="@comment "
 .endif
 
+.if defined(WITH_NAMAZU2)
+.if defined(PKGNAMEPREFIX) && ${PKGNAMEPREFIX} == "ja-"
+RUN_DEPENDS+=	mknmz:${PORTSDIR}/japanese/namazu2
+.else
+RUN_DEPENDS+=	mknmz:${PORTSDIR}/databases/namazu2
+.endif
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-Mailman-Cgi-private.py
+SUB_FILES=	pkg-message-namazu2
+.endif
+
 pre-fetch:
 	@${ECHO} ""
 	@${ECHO} "You may change the following build options:"
Index: files/extra-patch-Mailman-Cgi-private.py
===================================================================
RCS file: files/extra-patch-Mailman-Cgi-private.py
diff -N files/extra-patch-Mailman-Cgi-private.py
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/extra-patch-Mailman-Cgi-private.py	8 Apr 2011 13:32:50 -0000
@@ -0,0 +1,30 @@
+--- Mailman/Cgi/private.py.orig	2010-09-21 03:18:27.000000000 +0900
++++ Mailman/Cgi/private.py	2011-04-08 22:28:09.000000000 +0900
+@@ -116,6 +116,7 @@
+ 
+     i18n.set_language(mlist.preferred_language)
+     doc.set_language(mlist.preferred_language)
++    is_cgi = 0
+ 
+     cgidata = cgi.FieldStorage()
+     username = cgidata.getvalue('username', '')
+@@ -179,6 +180,10 @@
+         elif true_filename.endswith('.gz'):
+             import gzip
+             f = gzip.open(true_filename, 'r')
++        elif true_filename.endswith('namazu.cgi'):
++            os.putenv('SCRIPT_NAME', 'namazu.cgi')
++            f = os.popen(true_filename, 'r')
++            is_cgi = 1
+         else:
+             f = open(true_filename, 'r')
+     except IOError:
+@@ -188,6 +193,7 @@
+         print doc.Format()
+         syslog('error', 'Private archive file not found: %s', true_filename)
+     else:
+-        print 'Content-type: %s\n' % ctype
++        if not is_cgi:
++            print 'Content-type: %s\n' % ctype
+         sys.stdout.write(f.read())
+         f.close()
Index: files/pkg-message-namazu2.in
===================================================================
RCS file: files/pkg-message-namazu2.in
diff -N files/pkg-message-namazu2.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/pkg-message-namazu2.in	9 Apr 2011 12:23:11 -0000
@@ -0,0 +1,29 @@
+----------------------------------------------------------------------------
+Mailman has been installed, but requires further configuration before use!
+
+You will have to configure both your MTA (mail server) and web server to
+integrate with Mailman.  If the port's documentation has been installed,
+extensive post-installation instructions may be found in:
+
+  %%DOCSDIR%%/FreeBSD-post-install-notes
+
+Note (1):  If you use an alternate (non-Sendmail) MTA, you MUST be sure
+that the correct value of MAIL_GID was used when this port or package
+was built.  Performing a "make config" in the Mailman port directory
+you can choose your MTA with the correct MAIL_GID.
+
+Note (2):  The entire Mailman installation resides under %%MAILMANDIR%%
+The command-line scripts necessary to administer Mailman have been
+installed in %%MAILMANDIR%%/bin
+
+Note (3):  As of version 2.1, Mailman's queue runner runs as a daemon and
+is started by a script in %%LOCALBASE%%/etc/rc.d
+
+In order to make private archives searchable with namazu2, you need copy
+or link %%LOCALBASE%%/libexce/namazu.cgi to
+%%MAILMANDIR%%/archives/private/<ML name>/ and configure .namazurc
+to refer to %%LOCALBASE%%/etc/namazu/namazu-sample.
+See also
+http://www.python.jp/pipermail/mailman-users-jp/2004-August/001008.html
+written in Japanese.
+----------------------------------------------------------------------------
--- mailman-2.1.14_2.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list