Please unblock bley/0.1.3-1
Dear RT,
please unblock bley/0.1.3-1 for Squeeze. The diff is attached, it
consists of the two upstream changes (both for stability: reconnect to
restarted databases and strip unicode chars from the input), a typo fix
in the long description, new standards version and quoted BSD license in
debian/copyright.
TIA
Evgeni
diff -Nru bley-0.1.2/bley bley-0.1.3/bley
--- bley-0.1.2/bley 2010-06-01 13:13:56.000000000 +0200
+++ bley-0.1.3/bley 2010-08-15 09:06:07.000000000 +0200
@@ -89,7 +89,7 @@
def bley_start():
- parser = OptionParser(version='0.1.2')
+ parser = OptionParser(version='0.1.3')
parser.add_option("-p", "--pidfile", dest="pid_file",
help="use PID_FILE for storing the PID")
parser.add_option("-c", "--config", dest="conffile",
diff -Nru bley-0.1.2/bley.egg-info/PKG-INFO bley-0.1.3/bley.egg-info/PKG-INFO
--- bley-0.1.2/bley.egg-info/PKG-INFO 2010-06-01 13:15:21.000000000 +0200
+++ bley-0.1.3/bley.egg-info/PKG-INFO 2010-08-15 09:07:13.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: bley
-Version: 0.1.2
+Version: 0.1.3
Summary: intelligent greylisting daemon for postfix
Home-page: http://bley.mx
Author: Evgeni Golov
diff -Nru bley-0.1.2/bley.py bley-0.1.3/bley.py
--- bley-0.1.2/bley.py 2010-06-01 13:13:32.000000000 +0200
+++ bley-0.1.3/bley.py 2010-08-15 09:05:04.000000000 +0200
@@ -35,6 +35,8 @@
from bleyhelpers import *
from postfix import PostfixPolicy
+from time import sleep
+
class BleyPolicy(PostfixPolicy):
'''Implementation of intelligent greylisting based on `PostfixPolicy`'''
@@ -136,7 +138,7 @@
query = "INSERT INTO bley_status (ip, status, last_action, sender, recipient) VALUES(%(client_address)s, %(new_status)s, NOW(), %(sender)s, %(recipient)s)"
postfix_params['new_status'] = new_status
try:
- self.dbc.execute(query, postfix_params)
+ self.safe_execute(query, postfix_params)
except:
# the other thread already commited while we checked, ignore
pass
@@ -153,14 +155,14 @@
action = 'DEFER_IF_PERMIT %s' % self.factory.settings.reject_msg
query = "UPDATE bley_status SET fail_count=fail_count+1 WHERE ip=%(client_address)s AND sender=%(sender)s AND recipient=%(recipient)s"
self.factory.bad_cache[postfix_params['client_address']] = datetime.datetime.now()
- self.dbc.execute(query, postfix_params)
+ self.safe_execute(query, postfix_params)
self.db.commit()
else: # found to be clean
check_results['DB'] = status[0]
action = 'DUNNO'
query = "UPDATE bley_status SET last_action=NOW() WHERE ip=%(client_address)s AND sender=%(sender)s AND recipient=%(recipient)s"
- self.dbc.execute(query, postfix_params)
+ self.safe_execute(query, postfix_params)
self.db.commit()
self.factory.good_cache[postfix_params['client_address']] = datetime.datetime.now()
@@ -187,7 +189,7 @@
ORDER BY status ASC
LIMIT 1"""
try:
- self.dbc.execute(query, postfix_params)
+ self.safe_execute(query, postfix_params)
result = self.dbc.fetchone()
except:
result = None
@@ -257,6 +259,24 @@
d = client.lookupAddress(lookup)
return d
+ def safe_execute(self, query, params=None):
+ try:
+ self.dbc.execute(query, params)
+ except self.factory.settings.database.OperationalError:
+ try:
+ self.db.close()
+ except:
+ pass
+ self.db = None
+ while not self.db:
+ try:
+ self.db = self.factory.settings.database.connect(**self.factory.settings.dbsettings)
+ self.dbc = self.db.cursor()
+ except self.factory.settings.database.OperationalError:
+ self.db = None
+ sleep(1)
+ self.dbc.execute(query, params)
+
class BleyPolicyFactory(Factory):
protocol = BleyPolicy
diff -Nru bley-0.1.2/debian/changelog bley-0.1.3/debian/changelog
--- bley-0.1.2/debian/changelog 2010-06-01 15:50:07.000000000 +0200
+++ bley-0.1.3/debian/changelog 2010-08-15 13:47:57.000000000 +0200
@@ -1,3 +1,14 @@
+bley (0.1.3-1) unstable; urgency=low
+
+ * New upstream release
+ * debian/control:
+ + Standards-Version: 3.9.1
+ + Fix typo in description (Closes: #591214)
+ * debian/copyright:
+ + Quote BSD license, thanks lintian.
+
+ -- Evgeni Golov <evgeni@debian.org> Sun, 15 Aug 2010 13:47:43 +0200
+
bley (0.1.2-1) unstable; urgency=low
* New upstream release
diff -Nru bley-0.1.2/debian/control bley-0.1.3/debian/control
--- bley-0.1.2/debian/control 2010-06-01 15:47:19.000000000 +0200
+++ bley-0.1.3/debian/control 2010-08-15 13:45:27.000000000 +0200
@@ -3,7 +3,7 @@
Priority: optional
Maintainer: Evgeni Golov <evgeni@debian.org>
Build-Depends: debhelper (>= 7.0.50~), python-support, python-setuptools
-Standards-Version: 3.8.4
+Standards-Version: 3.9.1
XS-Python-Version: 2.5, 2.6
Homepage: http://bley.mx
@@ -16,5 +16,5 @@
XB-Python-Version: ${python:Versions}
Description: intelligent greylisting daemon for Postfix
bley uses various test (incl. RBL and SPF) to decide whether a sender
- should be grylisted or not, thus mostly eliminating the usual
+ should be greylisted or not, thus mostly eliminating the usual
greylisting delay while still filtering most of the spam.
diff -Nru bley-0.1.2/debian/copyright bley-0.1.3/debian/copyright
--- bley-0.1.2/debian/copyright 2010-04-20 11:22:30.000000000 +0200
+++ bley-0.1.3/debian/copyright 2010-08-15 13:47:41.000000000 +0200
@@ -6,7 +6,27 @@
Files: *
Copyright: 2009-2010 Evgeni Golov <evgeni@debian.org>
License: 3-BSD
-
-On Debian systems, the complete text of the BSD License can be
-found in "/usr/share/common-licenses/BSD".
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+.
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.
diff -Nru bley-0.1.2/PKG-INFO bley-0.1.3/PKG-INFO
--- bley-0.1.2/PKG-INFO 2010-06-01 13:15:21.000000000 +0200
+++ bley-0.1.3/PKG-INFO 2010-08-15 09:07:13.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: bley
-Version: 0.1.2
+Version: 0.1.3
Summary: intelligent greylisting daemon for postfix
Home-page: http://bley.mx
Author: Evgeni Golov
diff -Nru bley-0.1.2/postfix.py bley-0.1.3/postfix.py
--- bley-0.1.2/postfix.py 2010-04-13 18:09:06.000000000 +0200
+++ bley-0.1.3/postfix.py 2010-07-12 10:11:10.000000000 +0200
@@ -45,6 +45,10 @@
else:
try:
(pkey, pval) = line.split('=', 1)
+ try:
+ pval = pval.decode('utf-8', 'ignore').encode('us-ascii', 'ignore')
+ except:
+ pass
self.params[pkey] = pval
except:
print 'Could not parse "%s"' % line
diff -Nru bley-0.1.2/setup.py bley-0.1.3/setup.py
--- bley-0.1.2/setup.py 2010-06-01 13:13:48.000000000 +0200
+++ bley-0.1.3/setup.py 2010-08-15 09:05:56.000000000 +0200
@@ -2,7 +2,7 @@
setup(
name = "bley",
- version = "0.1.2",
+ version = "0.1.3",
description = "intelligent greylisting daemon for postfix",
author = "Evgeni Golov",
author_email = "sargentd@die-welt.net",
Reply to: