Date: Sat, 12 Aug 2006 06:38:48 GMT From: Milan Obuch <bsd@dino.sk> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/101862: [new port] courier-pythonfilter Message-ID: <200608120638.k7C6cm5F058393@www.freebsd.org> Resent-Message-ID: <200608120640.k7C6eFmJ077452@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 101862 >Category: ports >Synopsis: [new port] courier-pythonfilter >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 Aug 12 06:40:15 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Milan Obuch >Release: 6.1-STABLE >Organization: >Environment: FreeBSD lex.dino.sk 6.1-STABLE FreeBSD 6.1-STABLE #2: Fri Jul 14 02:35:35 CEST 2006 root@lex.dino.sk:/usr/obj/usr/src/sys/LEX i386 >Description: Courier filtering framework in puthon >How-To-Repeat: >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # courier-pythonfilter/Makefile # courier-pythonfilter/distinfo # courier-pythonfilter/files # courier-pythonfilter/pkg-descr # courier-pythonfilter/pkg-plist # courier-pythonfilter/files/patch-filters::comeagain.py # courier-pythonfilter/files/patch-filters::dialback.py # courier-pythonfilter/files/patch-pythonfilter.conf # courier-pythonfilter/files/patch-setup.py # courier-pythonfilter/files/patch-whitelist_auth.py # echo x - courier-pythonfilter/Makefile sed 's/^X//' >courier-pythonfilter/Makefile << 'END-of-courier-pythonfilter/Makefile' X# New ports collection makefile for: courier-pythonfilter X# Date created: Jun 19, 2006 X# Whom: Milan Obuch X# X# $FreeBSD: ??? $ X# X XPORTNAME= courier-pythonfilter XPORTVERSION= 0.9 XCATEGORIES= mail python XMASTER_SITES= http://phantom.dragonsdawn.net/~gordon/courier-patches/courier-pythonfilter/ X XMAINTAINER= bsd@dino.sk XCOMMENT= Framework for courier filter development in python X XUSE_PYTHON= yes XUSE_PYDISTUTILS= yes X XBUILD_DEPENDS= courier-config:${PORTSDIR}/mail/courier X XMAILOWN= courier XMAILGRP= courier XMAILUID= 465 XMAILGID= 465 X Xpost-extract: X ${MV} ${WRKSRC}/filters/whitelist-auth.py ${WRKSRC}/filters/whitelist_auth.py X XLOCALSTATEDIR= /var/spool/courier XSCRIPTSDIR= ${PREFIX}/libexec/filters X Xpost-install: X ${MKDIR} ${LOCALSTATEDIR}/pythonfilter X ${CHOWN} ${MAILOWN}:${MAILGRP} ${LOCALSTATEDIR}/pythonfilter X X.include <bsd.port.mk> X XPYDISTUTILS_INSTALLARGS:= ${PYDISTUTILS_INSTALLARGS} --install-scripts=${SCRIPTSDIR} END-of-courier-pythonfilter/Makefile echo x - courier-pythonfilter/distinfo sed 's/^X//' >courier-pythonfilter/distinfo << 'END-of-courier-pythonfilter/distinfo' XMD5 (courier-pythonfilter-0.9.tar.gz) = 06d2c901ba6b700298da1c649d2788b9 XSHA256 (courier-pythonfilter-0.9.tar.gz) = 6840d63817ccae143f2c889d31e91f73a05966db350a7c5472e4859b278c84b3 XSIZE (courier-pythonfilter-0.9.tar.gz) = 27084 END-of-courier-pythonfilter/distinfo echo c - courier-pythonfilter/files mkdir -p courier-pythonfilter/files > /dev/null 2>&1 echo x - courier-pythonfilter/pkg-descr sed 's/^X//' >courier-pythonfilter/pkg-descr << 'END-of-courier-pythonfilter/pkg-descr' XCourier pythonfilter X Xpythonfilter is a framework for developing courierfilter programs in XPython. The pythonfilter program itself is a multi-threaded daemon Xthat loads filters as python modules and passes the control and data Xfiles from courier to each module in turn. X Xpythonfilter includes several modules that provide utility functions. XThese modules are found in the "courier" directory. The "config" Xmodule provides functions to access or interpret Courier's Xconfiguration settings. The "control" module provides functions Xto interpret Courier's control files. X Xpythonfilter is distributed under the GNU General Public License X(GPL), as described in the COPYING file. END-of-courier-pythonfilter/pkg-descr echo x - courier-pythonfilter/pkg-plist sed 's/^X//' >courier-pythonfilter/pkg-plist << 'END-of-courier-pythonfilter/pkg-plist' Xetc/pythonfilter.conf Xlibexec/filters/pythonfilter X%%PYTHON_SITELIBDIR%%/courier/__init__.py X%%PYTHON_SITELIBDIR%%/courier/__init__.pyc X%%PYTHON_SITELIBDIR%%/courier/__init__.pyo X%%PYTHON_SITELIBDIR%%/courier/config.py X%%PYTHON_SITELIBDIR%%/courier/config.pyc X%%PYTHON_SITELIBDIR%%/courier/config.pyo X%%PYTHON_SITELIBDIR%%/courier/control.py X%%PYTHON_SITELIBDIR%%/courier/control.pyc X%%PYTHON_SITELIBDIR%%/courier/control.pyo X%%PYTHON_SITELIBDIR%%/courier/xfilter.py X%%PYTHON_SITELIBDIR%%/courier/xfilter.pyc X%%PYTHON_SITELIBDIR%%/courier/xfilter.pyo X%%PYTHON_SITELIBDIR%%/pythonfilter/__init__.py X%%PYTHON_SITELIBDIR%%/pythonfilter/__init__.pyc X%%PYTHON_SITELIBDIR%%/pythonfilter/__init__.pyo X%%PYTHON_SITELIBDIR%%/pythonfilter/attachments.py X%%PYTHON_SITELIBDIR%%/pythonfilter/attachments.pyc X%%PYTHON_SITELIBDIR%%/pythonfilter/attachments.pyo X%%PYTHON_SITELIBDIR%%/pythonfilter/clamav.py X%%PYTHON_SITELIBDIR%%/pythonfilter/clamav.pyc X%%PYTHON_SITELIBDIR%%/pythonfilter/clamav.pyo X%%PYTHON_SITELIBDIR%%/pythonfilter/comeagain.py X%%PYTHON_SITELIBDIR%%/pythonfilter/comeagain.pyc X%%PYTHON_SITELIBDIR%%/pythonfilter/comeagain.pyo X%%PYTHON_SITELIBDIR%%/pythonfilter/debug.py X%%PYTHON_SITELIBDIR%%/pythonfilter/debug.pyc X%%PYTHON_SITELIBDIR%%/pythonfilter/debug.pyo X%%PYTHON_SITELIBDIR%%/pythonfilter/dialback.py X%%PYTHON_SITELIBDIR%%/pythonfilter/dialback.pyc X%%PYTHON_SITELIBDIR%%/pythonfilter/dialback.pyo X%%PYTHON_SITELIBDIR%%/pythonfilter/noduplicates.py X%%PYTHON_SITELIBDIR%%/pythonfilter/noduplicates.pyc X%%PYTHON_SITELIBDIR%%/pythonfilter/noduplicates.pyo X%%PYTHON_SITELIBDIR%%/pythonfilter/nosuccessdsn.py X%%PYTHON_SITELIBDIR%%/pythonfilter/nosuccessdsn.pyc X%%PYTHON_SITELIBDIR%%/pythonfilter/nosuccessdsn.pyo X%%PYTHON_SITELIBDIR%%/pythonfilter/ratelimit.py X%%PYTHON_SITELIBDIR%%/pythonfilter/ratelimit.pyc X%%PYTHON_SITELIBDIR%%/pythonfilter/ratelimit.pyo X%%PYTHON_SITELIBDIR%%/pythonfilter/spfcheck.py X%%PYTHON_SITELIBDIR%%/pythonfilter/spfcheck.pyc X%%PYTHON_SITELIBDIR%%/pythonfilter/spfcheck.pyo X%%PYTHON_SITELIBDIR%%/pythonfilter/whitelist_auth.py X%%PYTHON_SITELIBDIR%%/pythonfilter/whitelist_auth.pyc X%%PYTHON_SITELIBDIR%%/pythonfilter/whitelist_auth.pyo X%%PYTHON_SITELIBDIR%%/pythonfilter/whitelist.py X%%PYTHON_SITELIBDIR%%/pythonfilter/whitelist.pyc X%%PYTHON_SITELIBDIR%%/pythonfilter/whitelist.pyo X@dirrm %%PYTHON_SITELIBDIR%%/courier X@dirrm %%PYTHON_SITELIBDIR%%/pythonfilter END-of-courier-pythonfilter/pkg-plist echo x - courier-pythonfilter/files/patch-filters::comeagain.py sed 's/^X//' >courier-pythonfilter/files/patch-filters::comeagain.py << 'END-of-courier-pythonfilter/files/patch-filters::comeagain.py' X--- filters/comeagain.py.orig Mon Dec 13 09:26:13 2004 X+++ filters/comeagain.py Thu Jul 27 08:34:25 2006 X@@ -27,7 +27,7 @@ X X # Keep a dictionary of sender/recipient pairs that we've seen before X _sendersLock = thread.allocate_lock() X-_sendersDir = '/var/state/pythonfilter' X+_sendersDir = '/var/spool/courier/pythonfilter' X try: X _senders = anydbm.open(_sendersDir + '/correspondents', 'c') X except: END-of-courier-pythonfilter/files/patch-filters::comeagain.py echo x - courier-pythonfilter/files/patch-filters::dialback.py sed 's/^X//' >courier-pythonfilter/files/patch-filters::dialback.py << 'END-of-courier-pythonfilter/files/patch-filters::dialback.py' X--- filters/dialback.py.orig Sun Dec 26 00:01:02 2004 X+++ filters/dialback.py Thu Jul 27 08:33:13 2006 X@@ -32,7 +32,7 @@ X # Keep a dictionary of authenticated senders to avoid more work than X # required. X _sendersLock = thread.allocate_lock() X-_sendersDir = '/var/state/pythonfilter' X+_sendersDir = '/var/spool/courier/pythonfilter' X try: X _goodSenders = anydbm.open(_sendersDir + '/goodsenders', 'c') X _badSenders = anydbm.open(_sendersDir + '/badsenders', 'c') END-of-courier-pythonfilter/files/patch-filters::dialback.py echo x - courier-pythonfilter/files/patch-pythonfilter.conf sed 's/^X//' >courier-pythonfilter/files/patch-pythonfilter.conf << 'END-of-courier-pythonfilter/files/patch-pythonfilter.conf' X--- pythonfilter.conf.orig Thu Jul 27 07:44:46 2006 X+++ pythonfilter.conf Thu Jul 27 07:44:56 2006 X@@ -11,8 +11,8 @@ X # whitelist: exempts IP addresses for which you relay from further filtering. X whitelist X X-# whitelist-auth: exempts users who authenticate from further filtering. X-whitelist-auth X+# whitelist_auth: exempts users who authenticate from further filtering. X+whitelist_auth X X # spfcheck: checks the sender against SPF records. X # Requires: spf - http://www.wayforward.net/spf/ END-of-courier-pythonfilter/files/patch-pythonfilter.conf echo x - courier-pythonfilter/files/patch-setup.py sed 's/^X//' >courier-pythonfilter/files/patch-setup.py << 'END-of-courier-pythonfilter/files/patch-setup.py' X--- setup.py.orig Mon Mar 13 20:44:45 2006 X+++ setup.py Wed Jul 26 21:21:34 2006 X@@ -15,5 +15,5 @@ X scripts=['pythonfilter'], X packages=['courier', 'pythonfilter'], X package_dir = {'pythonfilter': 'filters'}, X- data_files=[('/etc/', ['pythonfilter.conf'])] X+ data_files=[('/usr/local/etc/', ['pythonfilter.conf'])] X ) END-of-courier-pythonfilter/files/patch-setup.py echo x - courier-pythonfilter/files/patch-whitelist_auth.py sed 's/^X//' >courier-pythonfilter/files/patch-whitelist_auth.py << 'END-of-courier-pythonfilter/files/patch-whitelist_auth.py' X--- filters/whitelist_auth.py.orig Sun Dec 26 00:01:02 2004 X+++ filters/whitelist_auth.py Thu Jul 27 07:46:24 2006 X@@ -1,5 +1,5 @@ X #!/usr/bin/python X-# whitelist-auth -- Courier filter which exempts authenticated users from filtering X+# whitelist_auth -- Courier filter which exempts authenticated users from filtering X # Copyright (C) 2004 Gordon Messmer <gordon@dragonsdawn.net> X # X # This program is free software; you can redistribute it and/or modify X@@ -28,7 +28,7 @@ X _auth_regex = re.compile(r'\(AUTH: \w* \w*([^)]*)\)\s*by %s' % _hostname) X X # Record in the system log that this filter was initialized. X-sys.stderr.write('Initialized the "whitelist-auth" python filter\n') X+sys.stderr.write('Initialized the "whitelist_auth" python filter\n') X X X def checkHeader(header): X@@ -105,6 +105,6 @@ X # is whitelisted, or nothing to indicate that the remaining X # filters would be run. X if not sys.argv[1:]: X- print 'Use: whitelist-auth.py <control file>' X+ print 'Use: whitelist_auth.py <control file>' X sys.exit(1) X print doFilter(sys.argv[1], []) END-of-courier-pythonfilter/files/patch-whitelist_auth.py exit >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200608120638.k7C6cm5F058393>