ports/107651: [maintainer update] mail/courier-pythonfilter 0.16

Milan Obuch bsd at dino.sk
Sun Jan 7 12:50:07 UTC 2007


>Number:         107651
>Category:       ports
>Synopsis:       [maintainer update] mail/courier-pythonfilter 0.16
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 07 12:50:06 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Milan Obuch
>Release:        6.2-prerelease, mostly
>Organization:
>Environment:
FreeBSD fox.dino.sk 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #1: Tue Oct 24 22:19:56 CEST 2006     root at fox.dino.sk:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
New version
Optionify

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -uNr /usr/ports/mail/courier-pythonfilter/Makefile courier-pythonfilter/Makefile
--- /usr/ports/mail/courier-pythonfilter/Makefile	Thu Oct  5 01:28:42 2006
+++ courier-pythonfilter/Makefile	Sun Jan  7 12:44:50 2007
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	courier-pythonfilter
-PORTVERSION=	0.9
+PORTVERSION=	0.16
 CATEGORIES=	mail python
 MASTER_SITES=	http://phantom.dragonsdawn.net/~gordon/courier-patches/courier-pythonfilter/
 
@@ -26,13 +26,78 @@
 LOCALSTATEDIR=	/var/spool/courier
 SCRIPTSDIR=	${PREFIX}/libexec/filters
 
+OPTIONS=	debug		"debug module"			on \
+		noduplicates	"noduplicates module"		off \
+		clamav		"clamav module"			off \
+		auto_whitelist	"auto_whitelist module"		off \
+		whitelist	"whitelist module"		on \
+		whitelist_auth	"whitelist_auth module"		on \
+		privateaddr	"privateaddr module"		off \
+		spfcheck	"spfcheck module"		off \
+		nosuccessdsn	"nosuccessdsn module"		off \
+		comeagain	"comeagain module"		off \
+		greylist	"greylist module"		off \
+		dialback	"dialback module"		off \
+		ratelimit	"ratelimit module"		off \
+		attachments	"attachments module"		off
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_clamav) && !defined(WITHOUT_clamav)
+BUILD_DEPENDS+=	${PYTHON_SITELIBDIR}/pyclamav.so:${PORTSDIR}/security/py-clamav
+.endif
+
 post-extract:
-	${MV} ${WRKSRC}/filters/whitelist-auth.py ${WRKSRC}/filters/whitelist_auth.py
+	${MV} ${WRKSRC}/pythonfilter.conf ${WRKSRC}/pythonfilter.conf.sample
 
 post-install:
 	${MKDIR} ${LOCALSTATEDIR}/pythonfilter
 	${CHOWN} ${MAILOWN}:${MAILGRP} ${LOCALSTATEDIR}/pythonfilter
+	@${ECHO_MSG} Creating config file...
+	@${RM} -f ${PREFIX}/etc/pythonfilter.conf
+.if defined(WITH_debug) && !defined(WITHOUT_debug)
+	@${ECHO_MSG} debug >> ${PREFIX}/etc/pythonfilter.conf
+.endif
+.if defined(WITH_noduplicates) && !defined(WITHOUT_noduplicates)
+	@${ECHO_MSG} noduplicate >> ${PREFIX}/etc/pythonfilter.conf
+.endif
+.if defined(WITH_clamav) && !defined(WITHOUT_clamav)
+	@${ECHO_MSG} clamav >> ${PREFIX}/etc/pythonfilter.conf
+.endif
+.if defined(WITH_auto_whitelist) && !defined(WITHOUT_auto_whitelist)
+	@${ECHO_MSG} auto_whitelist >> ${PREFIX}/etc/pythonfilter.conf
+.endif
+.if defined(WITH_whitelist) && !defined(WITHOUT_whitelist)
+	@${ECHO_MSG} whitelist >> ${PREFIX}/etc/pythonfilter.conf
+.endif
+.if defined(WITH_whitelist_auth) && !defined(WITHOUT_whitelist_auth)
+	@${ECHO_MSG} whitelist_auth >> ${PREFIX}/etc/pythonfilter.conf
+.endif
+.if defined(WITH_privateaddr) && !defined(WITHOUT_privateaddr)
+	@${ECHO_MSG} privateaddr >> ${PREFIX}/etc/pythonfilter.conf
+.endif
+.if defined(WITH_spfcheck) && !defined(WITHOUT_spfcheck)
+	@${ECHO_MSG} spfcheck >> ${PREFIX}/etc/pythonfilter.conf
+.endif
+.if defined(WITH_nosuccessdsn) && !defined(WITHOUT_nosuccessdsn)
+	@${ECHO_MSG} nosuccessdsn >> ${PREFIX}/etc/pythonfilter.conf
+.endif
+.if defined(WITH_comeagain) && !defined(WITHOUT_comeagain)
+	@${ECHO_MSG} comeagain >> ${PREFIX}/etc/pythonfilter.conf
+.endif
+.if defined(WITH_greylist) && !defined(WITHOUT_greylist)
+	@${ECHO_MSG} greylist >> ${PREFIX}/etc/pythonfilter.conf
+.endif
+.if defined(WITH_dialback) && !defined(WITHOUT_dialback)
+	@${ECHO_MSG} dialback >> ${PREFIX}/etc/pythonfilter.conf
+.endif
+.if defined(WITH_ratelimit) && !defined(WITHOUT_ratelimit)
+	@${ECHO_MSG} ratelimit >> ${PREFIX}/etc/pythonfilter.conf
+.endif
+.if defined(WITH_attachments) && !defined(WITHOUT_attachments)
+	@${ECHO_MSG} attachments >> ${PREFIX}/etc/pythonfilter.conf
+.endif
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
 
 PYDISTUTILS_INSTALLARGS:=	${PYDISTUTILS_INSTALLARGS} --install-scripts=${SCRIPTSDIR}
diff -uNr /usr/ports/mail/courier-pythonfilter/distinfo courier-pythonfilter/distinfo
--- /usr/ports/mail/courier-pythonfilter/distinfo	Thu Oct  5 01:28:42 2006
+++ courier-pythonfilter/distinfo	Fri Jan  5 23:37:27 2007
@@ -1,3 +1,3 @@
-MD5 (courier-pythonfilter-0.9.tar.gz) = 06d2c901ba6b700298da1c649d2788b9
-SHA256 (courier-pythonfilter-0.9.tar.gz) = 6840d63817ccae143f2c889d31e91f73a05966db350a7c5472e4859b278c84b3
-SIZE (courier-pythonfilter-0.9.tar.gz) = 27084
+MD5 (courier-pythonfilter-0.16.tar.gz) = 67998e92c107a1a55099c9c038084a32
+SHA256 (courier-pythonfilter-0.16.tar.gz) = d57c675bdcba52dea0fe7b29e8b39902703e05841a315fa2075b2d1ba0f75c14
+SIZE (courier-pythonfilter-0.16.tar.gz) = 33160
diff -uNr /usr/ports/mail/courier-pythonfilter/files/patch-courier__config.py courier-pythonfilter/files/patch-courier__config.py
--- /usr/ports/mail/courier-pythonfilter/files/patch-courier__config.py	Thu Jan  1 01:00:00 1970
+++ courier-pythonfilter/files/patch-courier__config.py	Mon Jan  1 18:40:17 2007
@@ -0,0 +1,45 @@
+--- courier/config.py.orig	Fri Dec  1 18:59:03 2006
++++ courier/config.py	Wed Dec 20 23:36:38 2006
+@@ -23,32 +23,11 @@
+ import socket
+ 
+ 
+-sysconf = '/etc/courier'
+-prefix  = '/usr/lib/courier'
++sysconf = '/usr/local/etc/courier'
++prefix  = '/usr/local'
+ spool   = '/var/spool/courier'
+ 
+ 
+-def _setup():
+-    sysconfs = ['/etc/courier', '/usr/lib/courier/etc']
+-    prefixes = ['/usr/lib/courier']
+-    spools = ['/var/lib/courier', '/var/spool/courier', '/usr/lib/courier/var/spool/courier']
+-    global sysconf
+-    global prefix
+-    global spool
+-    for x in sysconfs:
+-        if os.path.isdir(x):
+-            sysconf = x
+-            break
+-    for x in prefixes:
+-        if os.path.isdir(x):
+-            prefix = x
+-            break
+-    for x in spools:
+-        if os.path.isdir(x):
+-            spool = x
+-            break
+-
+-
+ def read1line(file):
+     try:
+         cfile = open(sysconf + '/' + file, 'r')
+@@ -283,7 +263,3 @@
+ 
+     """
+     return getSmtpaccessVal('BLOCK', ip)
+-
+-
+-# Call _setup to correct the module path values
+-_setup()
diff -uNr /usr/ports/mail/courier-pythonfilter/files/patch-filters__TtlDb.py courier-pythonfilter/files/patch-filters__TtlDb.py
--- /usr/ports/mail/courier-pythonfilter/files/patch-filters__TtlDb.py	Thu Jan  1 01:00:00 1970
+++ courier-pythonfilter/files/patch-filters__TtlDb.py	Mon Jan  1 18:40:17 2007
@@ -0,0 +1,11 @@
+--- filters/TtlDb.py.orig	Tue Dec 19 21:12:26 2006
++++ filters/TtlDb.py	Wed Dec 20 22:30:21 2006
+@@ -22,7 +22,7 @@
+ import time
+ 
+ 
+-_dbmDir = '/var/state/pythonfilter'
++_dbmDir = '/var/spool/courier/pythonfilter'
+ 
+ 
+ class TtlDbError(Exception):
diff -uNr /usr/ports/mail/courier-pythonfilter/files/patch-filters__clamav.py courier-pythonfilter/files/patch-filters__clamav.py
--- /usr/ports/mail/courier-pythonfilter/files/patch-filters__clamav.py	Thu Jan  1 01:00:00 1970
+++ courier-pythonfilter/files/patch-filters__clamav.py	Sun Jan  7 12:32:25 2007
@@ -0,0 +1,18 @@
+--- filters/clamav.py.orig	Sat Dec 16 03:11:51 2006
++++ filters/clamav.py	Sun Jan  7 10:56:30 2007
+@@ -31,13 +31,13 @@
+     except Exception, e:
+         return "554 " + str(e)
+     if avresult[0]:
+-        return "554 %s was detected. Abort!" % avresult[1]
++        return "554 Virus found - Signature is %s" % avresult[1]
+     return ''
+ 
+ 
+ if __name__ == '__main__':
+     # we only work with 1 parameter
+     if len(sys.argv) != 2:
+-        print "Usage: attachment.py <message_body_file>"
++        print "Usage: clamav.py <message_body_file>"
+         sys.exit(0)
+     print doFilter(sys.argv[1], "")
diff -uNr /usr/ports/mail/courier-pythonfilter/files/patch-filters__comeagain.py courier-pythonfilter/files/patch-filters__comeagain.py
--- /usr/ports/mail/courier-pythonfilter/files/patch-filters__comeagain.py	Thu Oct  5 01:28:43 2006
+++ courier-pythonfilter/files/patch-filters__comeagain.py	Sun Jan  7 12:36:06 2007
@@ -1,11 +1,23 @@
---- filters/comeagain.py.orig  Mon Dec 13 09:26:13 2004
-+++ filters/comeagain.py       Thu Jul 27 08:34:25 2006
-@@ -27,7 +27,7 @@
-
- # Keep a dictionary of sender/recipient pairs that we've seen before
- _sendersLock = thread.allocate_lock()
--_sendersDir = '/var/state/pythonfilter'
-+_sendersDir = '/var/spool/courier/pythonfilter'
- try:
-     _senders = anydbm.open(_sendersDir + '/correspondents', 'c')
- except:
+--- filters/comeagain.py.orig	Tue Jan  2 22:02:12 2007
++++ filters/comeagain.py	Sun Jan  7 12:35:20 2007
+@@ -89,11 +89,7 @@
+     if foundAll:
+         return ''
+     else:
+-        return('421-Please send the message again.\n'
+-               '421-This is not an indication of a problem:  We require\n'
+-               '421-that any new sender retry their delivery as proof that\n'
+-               '421-they are not spamware or virusware.\n'
+-               '421 Thank you.')
++        return('421 Please send the message again to proof you are not spamware or virusware.')
+ 
+ 
+ if __name__ == '__main__':
+@@ -103,6 +99,6 @@
+     # recipient.  Run this script with the name of that file as an
+     # argument, and it'll validate that email address.
+     if not sys.argv[1:]:
+-        print 'Use:  comeagain.py <control file>'
++        print 'Use: comeagain.py <control file>'
+         sys.exit(1)
+     print doFilter('', sys.argv[1:])
diff -uNr /usr/ports/mail/courier-pythonfilter/files/patch-filters__dialback.py courier-pythonfilter/files/patch-filters__dialback.py
--- /usr/ports/mail/courier-pythonfilter/files/patch-filters__dialback.py	Thu Oct  5 01:28:43 2006
+++ courier-pythonfilter/files/patch-filters__dialback.py	Thu Jan  1 01:00:00 1970
@@ -1,11 +0,0 @@
---- filters/dialback.py.orig   Sun Dec 26 00:01:02 2004
-+++ filters/dialback.py        Thu Jul 27 08:33:13 2006
-@@ -32,7 +32,7 @@
- # Keep a dictionary of authenticated senders to avoid more work than
- # required.
- _sendersLock = thread.allocate_lock()
--_sendersDir = '/var/state/pythonfilter'
-+_sendersDir = '/var/spool/courier/pythonfilter'
- try:
-     _goodSenders = anydbm.open(_sendersDir + '/goodsenders', 'c')
-     _badSenders = anydbm.open(_sendersDir + '/badsenders', 'c')
diff -uNr /usr/ports/mail/courier-pythonfilter/files/patch-filters__greylist.py courier-pythonfilter/files/patch-filters__greylist.py
--- /usr/ports/mail/courier-pythonfilter/files/patch-filters__greylist.py	Thu Jan  1 01:00:00 1970
+++ courier-pythonfilter/files/patch-filters__greylist.py	Mon Jan  1 21:00:57 2007
@@ -0,0 +1,11 @@
+--- filters/greylist.py.orig	Mon Dec 11 23:58:12 2006
++++ filters/greylist.py	Mon Jan  1 21:00:42 2007
+@@ -51,7 +51,7 @@
+     sys.stderr.write(e.message)
+     sys.exit(1)
+ 
+-_whitelistDir = '/var/state/pythonfilter'
++_whitelistDir = '/var/spool/courier/pythonfilter'
+ try:
+     # messages which include these mail addresses either as sender or recipient
+     # should not be greylisted (could be your customer database)
diff -uNr /usr/ports/mail/courier-pythonfilter/files/patch-pythonfilter courier-pythonfilter/files/patch-pythonfilter
--- /usr/ports/mail/courier-pythonfilter/files/patch-pythonfilter	Thu Jan  1 01:00:00 1970
+++ courier-pythonfilter/files/patch-pythonfilter	Mon Jan  1 18:40:17 2007
@@ -0,0 +1,34 @@
+--- pythonfilter.orig	Fri Dec  1 19:59:03 2006
++++ pythonfilter	Thu Dec 28 12:44:19 2006
+@@ -71,17 +71,15 @@
+ # First, locate and open the configuration file.
+ config = None
+ try:
+-    configDirs = ('/etc', '/usr/local/etc')
+-    for x in configDirs:
+-        if os.access('%s/pythonfilter.conf' % x, os.R_OK):
+-            config = open('%s/pythonfilter.conf' % x)
+-            break
++    configDir = ('/usr/local/etc')
++    if os.access('%s/pythonfilter.conf' % configDir, os.R_OK):
++        config = open('%s/pythonfilter.conf' % configDir)
+ except IOError:
+     sys.stderr.write('Could not open config file for reading.\n')
+     sys.exit()
+ if not config:
+-    sys.stderr.write('Could not locate a configuration file in any of: %s\n',
+-                     configDirs)
++    sys.stderr.write('Could not locate a configuration file in %s\n',
++                     configDir)
+     sys.exit()
+ # Read the lines from the configuration file and load any module listed
+ # therein.  Ignore lines that begin with a hash character.
+@@ -106,7 +104,7 @@
+         sys.stderr.write('Failed to load "doFilter" '
+                          'function from %s\n' %
+                          moduleName)
+-        sys.stderr.write('Exception : %s:%s\n' %
++        sys.stderr.write('Exception: %s:%s\n' %
+                          (importError[0], importError[1]))
+         sys.stderr.write(string.join(traceback.format_tb(importError[2]), ''))
+ 
diff -uNr /usr/ports/mail/courier-pythonfilter/files/patch-pythonfilter.conf courier-pythonfilter/files/patch-pythonfilter.conf
--- /usr/ports/mail/courier-pythonfilter/files/patch-pythonfilter.conf	Thu Oct  5 01:28:43 2006
+++ courier-pythonfilter/files/patch-pythonfilter.conf	Thu Jan  1 01:00:00 1970
@@ -1,13 +0,0 @@
---- pythonfilter.conf.orig     Thu Jul 27 07:44:46 2006
-+++ pythonfilter.conf  Thu Jul 27 07:44:56 2006
-@@ -11,8 +11,8 @@
- # whitelist: exempts IP addresses for which you relay from further filtering.
- whitelist
-
--# whitelist-auth: exempts users who authenticate from further filtering.
--whitelist-auth
-+# whitelist_auth: exempts users who authenticate from further filtering.
-+whitelist_auth
-
- # spfcheck: checks the sender against SPF records.
- # Requires: spf - http://www.wayforward.net/spf/
diff -uNr /usr/ports/mail/courier-pythonfilter/files/patch-setup.py courier-pythonfilter/files/patch-setup.py
--- /usr/ports/mail/courier-pythonfilter/files/patch-setup.py	Thu Oct  5 01:28:43 2006
+++ courier-pythonfilter/files/patch-setup.py	Mon Jan  1 18:40:17 2007
@@ -5,5 +5,5 @@
        packages=['courier', 'pythonfilter'],
        package_dir = {'pythonfilter': 'filters'},
 -      data_files=[('/etc/', ['pythonfilter.conf'])]
-+      data_files=[('/usr/local/etc/', ['pythonfilter.conf'])]
++      data_files=[('/usr/local/etc/', ['pythonfilter.conf.sample'])]
       )
diff -uNr /usr/ports/mail/courier-pythonfilter/files/patch-whitelist_auth.py courier-pythonfilter/files/patch-whitelist_auth.py
--- /usr/ports/mail/courier-pythonfilter/files/patch-whitelist_auth.py	Thu Oct  5 01:28:43 2006
+++ courier-pythonfilter/files/patch-whitelist_auth.py	Thu Jan  1 01:00:00 1970
@@ -1,26 +0,0 @@
---- filters/whitelist_auth.py.orig     Sun Dec 26 00:01:02 2004
-+++ filters/whitelist_auth.py  Thu Jul 27 07:46:24 2006
-@@ -1,5 +1,5 @@
- #!/usr/bin/python
--# whitelist-auth -- Courier filter which exempts authenticated users from filtering
-+# whitelist_auth -- Courier filter which exempts authenticated users from filtering
- # Copyright (C) 2004  Gordon Messmer <gordon at dragonsdawn.net>
- #
- # This program is free software; you can redistribute it and/or modify
-@@ -28,7 +28,7 @@
- _auth_regex = re.compile(r'\(AUTH: \w* \w*([^)]*)\)\s*by %s' % _hostname)
-
- # Record in the system log that this filter was initialized.
--sys.stderr.write('Initialized the "whitelist-auth" python filter\n')
-+sys.stderr.write('Initialized the "whitelist_auth" python filter\n')
-
-
- def checkHeader(header):
-@@ -105,6 +105,6 @@
-     # is whitelisted, or nothing to indicate that the remaining
-     # filters would be run.
-     if not sys.argv[1:]:
--        print 'Use:  whitelist-auth.py <control file>'
-+        print 'Use:  whitelist_auth.py <control file>'
-         sys.exit(1)
-     print doFilter(sys.argv[1], [])
diff -uNr /usr/ports/mail/courier-pythonfilter/pkg-plist courier-pythonfilter/pkg-plist
--- /usr/ports/mail/courier-pythonfilter/pkg-plist	Thu Oct  5 01:28:42 2006
+++ courier-pythonfilter/pkg-plist	Mon Jan  1 18:40:17 2007
@@ -1,4 +1,4 @@
-etc/pythonfilter.conf
+etc/pythonfilter.conf.sample
 libexec/filters/pythonfilter
 %%PYTHON_SITELIBDIR%%/courier/__init__.py
 %%PYTHON_SITELIBDIR%%/courier/__init__.pyc
@@ -15,9 +15,15 @@
 %%PYTHON_SITELIBDIR%%/pythonfilter/__init__.py
 %%PYTHON_SITELIBDIR%%/pythonfilter/__init__.pyc
 %%PYTHON_SITELIBDIR%%/pythonfilter/__init__.pyo
+%%PYTHON_SITELIBDIR%%/pythonfilter/TtlDb.py
+%%PYTHON_SITELIBDIR%%/pythonfilter/TtlDb.pyc
+%%PYTHON_SITELIBDIR%%/pythonfilter/TtlDb.pyo
 %%PYTHON_SITELIBDIR%%/pythonfilter/attachments.py
 %%PYTHON_SITELIBDIR%%/pythonfilter/attachments.pyc
 %%PYTHON_SITELIBDIR%%/pythonfilter/attachments.pyo
+%%PYTHON_SITELIBDIR%%/pythonfilter/auto_whitelist.py
+%%PYTHON_SITELIBDIR%%/pythonfilter/auto_whitelist.pyc
+%%PYTHON_SITELIBDIR%%/pythonfilter/auto_whitelist.pyo
 %%PYTHON_SITELIBDIR%%/pythonfilter/clamav.py
 %%PYTHON_SITELIBDIR%%/pythonfilter/clamav.pyc
 %%PYTHON_SITELIBDIR%%/pythonfilter/clamav.pyo
@@ -30,12 +36,18 @@
 %%PYTHON_SITELIBDIR%%/pythonfilter/dialback.py
 %%PYTHON_SITELIBDIR%%/pythonfilter/dialback.pyc
 %%PYTHON_SITELIBDIR%%/pythonfilter/dialback.pyo
+%%PYTHON_SITELIBDIR%%/pythonfilter/greylist.py
+%%PYTHON_SITELIBDIR%%/pythonfilter/greylist.pyc
+%%PYTHON_SITELIBDIR%%/pythonfilter/greylist.pyo
 %%PYTHON_SITELIBDIR%%/pythonfilter/noduplicates.py
 %%PYTHON_SITELIBDIR%%/pythonfilter/noduplicates.pyc
 %%PYTHON_SITELIBDIR%%/pythonfilter/noduplicates.pyo
 %%PYTHON_SITELIBDIR%%/pythonfilter/nosuccessdsn.py
 %%PYTHON_SITELIBDIR%%/pythonfilter/nosuccessdsn.pyc
 %%PYTHON_SITELIBDIR%%/pythonfilter/nosuccessdsn.pyo
+%%PYTHON_SITELIBDIR%%/pythonfilter/privateaddr.py
+%%PYTHON_SITELIBDIR%%/pythonfilter/privateaddr.pyc
+%%PYTHON_SITELIBDIR%%/pythonfilter/privateaddr.pyo
 %%PYTHON_SITELIBDIR%%/pythonfilter/ratelimit.py
 %%PYTHON_SITELIBDIR%%/pythonfilter/ratelimit.pyc
 %%PYTHON_SITELIBDIR%%/pythonfilter/ratelimit.pyo

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



More information about the freebsd-ports-bugs mailing list