Bernd Plagge wrote:
I just installed pythonfilter 1.1.
Everything worked fine but for the greylisting filter which couldn't be
initialized.
- --
Apr 13 23:44:41 linde courierfilter: Failed to run "initFilter"
function from greylist Apr 13 23:44:41 linde courierfilter: Exception :
exceptions.AttributeError:OpenError instance has no attribute 'message'
Yuck. TtlDb couldn't open its database, and the error isn't logged
because of a recently introduced bug. The attached patch will fix the
logging bug. You probably haven't created the directory that TtlDb uses
for its dbm files, or haven't given the daemon/courier user write access
to it.
Check out the "Installation" section of the README file. If you want to
change the database location, modify /etc/pythonfilter-modules.conf.
Index: filters/dialback.py
===================================================================
RCS file: /home/gordon/src/cvsroot/courier-pythonfilter/filters/dialback.py,v
retrieving revision 1.32
diff -u -r1.32 dialback.py
--- filters/dialback.py 23 Mar 2008 08:06:04 -0000 1.32
+++ filters/dialback.py 13 Apr 2008 22:39:12 -0000
@@ -56,7 +56,7 @@
_goodSenders = TtlDb.TtlDb('goodsenders', sendersTTL, sendersPurgeInterval)
_badSenders = TtlDb.TtlDb('badsenders', sendersTTL, sendersPurgeInterval)
except TtlDb.OpenError, e:
- sys.stderr.write(e.message)
+ sys.stderr.write('Could not open dialback TtlDb: %s\n' % e)
sys.exit(1)
# Initialize the DNS module
DNS.DiscoverNameServers()
Index: filters/deliveredto.py
===================================================================
RCS file: /home/gordon/src/cvsroot/courier-pythonfilter/filters/deliveredto.py,v
retrieving revision 1.4
diff -u -r1.4 deliveredto.py
--- filters/deliveredto.py 23 Mar 2008 08:06:04 -0000 1.4
+++ filters/deliveredto.py 13 Apr 2008 22:39:12 -0000
@@ -40,7 +40,7 @@
return '451 Internal failure opening message data file'
try:
message = email.message_from_file(bfStream)
- except Exception, e:
+ except:
return '451 Internal failure parsing message data file'
if 'Delivered-To' in message:
dheader = message['Delivered-To']
Index: filters/auto_whitelist.py
===================================================================
RCS file: /home/gordon/src/cvsroot/courier-pythonfilter/filters/auto_whitelist.py,v
retrieving revision 1.12
diff -u -r1.12 auto_whitelist.py
--- filters/auto_whitelist.py 23 Mar 2008 08:06:04 -0000 1.12
+++ filters/auto_whitelist.py 13 Apr 2008 22:39:12 -0000
@@ -39,7 +39,7 @@
global _whitelist
_whitelist = TtlDb.TtlDb('auto_whitelist', whitelistTTL, whitelistPurgeInterval)
except TtlDb.OpenError, e:
- sys.stderr.write(e.message)
+ sys.stderr.write('Could not open auto_whitelist TtlDb: %s\n' % e)
sys.exit(1)
# Record in the system log that this filter was initialized.
sys.stderr.write('Initialized the "auto_whitelist" python filter\n')
Index: filters/comeagain.py
===================================================================
RCS file: /home/gordon/src/cvsroot/courier-pythonfilter/filters/comeagain.py,v
retrieving revision 1.19
diff -u -r1.19 comeagain.py
--- filters/comeagain.py 23 Mar 2008 08:06:04 -0000 1.19
+++ filters/comeagain.py 13 Apr 2008 22:39:12 -0000
@@ -39,7 +39,7 @@
global _senders
_senders = TtlDb.TtlDb('correspondents', sendersTTL, sendersPurgeInterval)
except TtlDb.OpenError, e:
- sys.stderr.write(e.message)
+ sys.stderr.write('Could not open comeagain TtlDb: %s\n' % e)
sys.exit(1)
# Record in the system log that this filter was initialized.
sys.stderr.write('Initialized the "comeagain" python filter\n')
Index: filters/greylist.py
===================================================================
RCS file: /home/gordon/src/cvsroot/courier-pythonfilter/filters/greylist.py,v
retrieving revision 1.13
diff -u -r1.13 greylist.py
--- filters/greylist.py 23 Mar 2008 08:06:04 -0000 1.13
+++ filters/greylist.py 13 Apr 2008 22:39:12 -0000
@@ -63,7 +63,7 @@
_sendersPassed = TtlDb.TtlDb('greylist_Passed', sendersPassedTTL, sendersPurgeInterval)
_sendersNotPassed = TtlDb.TtlDb('greylist_NotPassed', sendersNotPassedTTL, sendersPurgeInterval)
except TtlDb.OpenError, e:
- sys.stderr.write(e.message)
+ sys.stderr.write('Could not open greylist TtlDb: %s\n' % e)
sys.exit(1)
try:
Index: filters/quota.py
===================================================================
RCS file: /home/gordon/src/cvsroot/courier-pythonfilter/filters/quota.py,v
retrieving revision 1.6
diff -u -r1.6 quota.py
--- filters/quota.py 23 Mar 2008 08:06:04 -0000 1.6
+++ filters/quota.py 13 Apr 2008 22:39:12 -0000
@@ -44,10 +44,10 @@
except courier.authdaemon.KeyError:
# shouldn't happen if addr is local or hosted, and
# courier accepted the address
- sys.stderr.write('quota filter: authdaemon failed to look up "%s"' % addr)
+ sys.stderr.write('quota filter: authdaemon failed to look up "%s"\n' % addr)
return ''
except courier.authdaemon.IoError, e:
- sys.stderr.write('quota filter: authdaemon failed, "%s"' % e.message)
+ sys.stderr.write('quota filter: authdaemon failed, "%s"\n' % e)
return ''
if userInfo.has_key('MAILDIR'):
maildirsize = os.path.join(userInfo['MAILDIR'], 'maildirsize')
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users