atom feed8 messages in net.sourceforge.lists.courier-users[courier-users] Corrupted Pythonfilte...
FromSent OnAttachments
Paweł TęczaDec 12, 2008 3:32 am 
Paweł TęczaDec 15, 2008 1:05 am 
Paweł TęczaDec 15, 2008 5:07 am 
Paweł TęczaDec 17, 2008 8:38 am 
Gordon MessmerDec 17, 2008 9:28 am 
Paweł TęczaDec 18, 2008 1:59 am 
Paweł TęczaDec 18, 2008 4:39 am 
Gordon MessmerDec 18, 2008 11:06 am 
Subject:[courier-users] Corrupted Pythonfilter greylist_NotPassed database
From:Paweł Tęcza (pte@uw.edu.pl)
Date:Dec 12, 2008 3:32:21 am
List:net.sourceforge.lists.courier-users

Hello Gordon,

Yesterday I installed your Pythonfilter for my users to improve fighting spam using greylisting module. It has been working well for a few hours. Unfortunately after that time the greylist_NotPassed database has been corrupted:

Dec 11 18:37:29 xxx courierfilter: Uncaught exception in "greylist" doFilter function: <class 'bsddb.db.DBRunRecoveryError'>:(-30975, 'DB_RUNRECOVERY: Fatal error, run database recovery -- PANIC: fatal region error detected; run recovery') Dec 11 18:37:29 xxx courierfilter: File "/etc/courier/filters/active/pythonfilter", line 199, in processMessage Dec 11 18:37:29 xxx courierfilter: replyCode = i_filter[1](bodyFile, controlFileList) Dec 11 18:37:29 xxx courierfilter: File "/usr/lib/python2.5/site-packages/pythonfilter/greylist.py", line 160, in doFilter Dec 11 18:37:29 xxx courierfilter: _sendersNotPassed.unlock() Dec 11 18:37:29 xxx courierfilter: File "/usr/lib/python2.5/site-packages/pythonfilter/TtlDb.py", line 196, in unlock Dec 11 18:37:29 xxx courierfilter: self.db.sync() Dec 11 18:37:29 xxx courierfilter: File "bsddb/__init__.py", line 293, in sync Dec 11 18:37:29 xxx courierfilter: return _DeadlockWrap(self.db.sync)

In the Courier log file also I can see a lot of error messages like below:

Dec 12 11:00:06 xxx courierfilter: Uncaught exception in "greylist" doFilter function: <type 'exceptions.KeyError'>:'3d89ef72e9bbb1e4d677350b748b1832' Dec 12 11:00:06 xxx courierfilter: File "/etc/courier/filters/active/pythonfilter", line 199, in processMessage Dec 12 11:00:06 xxx courierfilter: replyCode = i_filter[1](bodyFile, controlFileList) Dec 12 11:00:06 xxx courierfilter: File "/usr/lib/python2.5/site-packages/pythonfilter/greylist.py", line 106, in doFilter Dec 12 11:00:06 xxx courierfilter: _sendersNotPassed.purge() Dec 12 11:00:06 xxx courierfilter: File "/usr/lib/python2.5/site-packages/pythonfilter/TtlDb.py", line 214, in purge Dec 12 11:00:06 xxx courierfilter: if float(self.db[key]) < minVal: Dec 12 11:00:06 xxx courierfilter: File "bsddb/__init__.py", line 223, in __getitem__ Dec 12 11:00:06 xxx courierfilter: return _DeadlockWrap(lambda: self.db[key]) # self.db[key] Dec 12 11:00:06 xxx courierfilter: File "bsddb/dbutils.py", line 62, in DeadlockWrap Dec 12 11:00:06 xxx courierfilter: File "bsddb/__init__.py", line 223, in <lambda> Dec 12 11:00:06 xxx courierfilter: return _DeadlockWrap(lambda: self.db[key]) # self.db[key]

I know that the greylist_NotPassed file is broken, because I checked it using `db4.6_verify` utility (Debian/Ubuntu db4.6-utils package):

# db4.6_verify greylist_Passed

# db4.6_verify greylist_NotPassed db4.6_verify: Page 20: hash page has bad prev_pgno db4.6_verify: Page 11: first page in hash bucket 9 has a prev_pgno db4.6_verify: Page 14: non-empty page in unused hash bucket 12 db4.6_verify: greylist_NotPassed: DB_VERIFY_BAD: Database verification failed

I've fixed it using `db4.6_dump` and `db4.6_load` tools (the same package):

# db4.6_dump greylist_NotPassed > greylist_NotPassed.dump # rm -f greylist_NotPassed # db4.6_load greylist_NotPassed < greylist_NotPassed.dump # db4.6_verify greylist_NotPassed

It seems to be OK now, but I'm affaid to enable Pythonfilter again :)

Here more details about my mail system. It includes a few virtual OpenVZ front-ends. My users Maildirs are shared between front-ends using NFS, so the greylist_* files was also shared via NFS. Do you think it matters?

I've read about PostgreSQL support for Pythonfilter, but supposedly it's experimental. Also I don't have PostgreSQL database right now.

What's your opinion about using NFS to sharing the greylist_* files? Do you think that PostgreSQL support is ready to use in stable and production environment?

My best regards,

Pawel