From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Apr 9 13:00:26 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE41B1065674 for ; Sat, 9 Apr 2011 13:00:26 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 56DE98FC1C for ; Sat, 9 Apr 2011 13:00:22 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p39D0Mnw039539 for ; Sat, 9 Apr 2011 13:00:22 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p39D0Mq9039538; Sat, 9 Apr 2011 13:00:22 GMT (envelope-from gnats) Resent-Date: Sat, 9 Apr 2011 13:00:22 GMT Resent-Message-Id: <201104091300.p39D0Mq9039538@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, TAKATSU Tomonari Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 213E6106566C for ; Sat, 9 Apr 2011 12:57:35 +0000 (UTC) (envelope-from tota@rtfm.jp) Received: from rtfm.jp (rtfm.jp [208.86.227.204]) by mx1.freebsd.org (Postfix) with ESMTP id B11F18FC0A for ; Sat, 9 Apr 2011 12:57:34 +0000 (UTC) Received: from rtfm.jp (localhost [127.0.0.1]) by rtfm.jp (8.14.4/8.14.4) with ESMTP id p39CvXkG045826; Sat, 9 Apr 2011 21:57:33 +0900 (JST) (envelope-from tota@rtfm.jp) Received: (from tota@localhost) by rtfm.jp (8.14.4/8.14.4/Submit) id p39CvXlp045825; Sat, 9 Apr 2011 21:57:33 +0900 (JST) (envelope-from tota) Message-Id: <201104091257.p39CvXlp045825@rtfm.jp> Date: Sat, 9 Apr 2011 21:57:33 +0900 (JST) From: TAKATSU Tomonari To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: wxs@FreeBSD.org Subject: ports/156296: [PATCH] mail/mailman: make private archives searchable with namazu2 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Apr 2011 13:00:26 -0000 >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@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// 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: