sb_imapfilter: bad FETCH response
FYI, with the CVS HEAD as of 18 January: Loading state from /usr/home/dave/hammie.new.db database /usr/home/dave/hammie.new.db is a new database Loading database /usr/home/dave/hammie.new.db... Done. Account: www.stlport.com:993 Training Training ham folder HamBox Traceback (most recent call last): File "/usr/home/dave/src/spambayes/scripts/sb_imapfilter.py", line 1283, in ? run() File "/usr/home/dave/src/spambayes/scripts/sb_imapfilter.py", line 1261, in run imap_filter.Train() File "/usr/home/dave/src/spambayes/scripts/sb_imapfilter.py", line 1004, in Train num_trained = folder.Train(self.classifier, is_spam) File "/usr/home/dave/src/spambayes/scripts/sb_imapfilter.py", line 888, in Train for msg in self: File "/usr/home/dave/src/spambayes/scripts/sb_imapfilter.py", line 799, in __iter__ yield self[key] File "/usr/home/dave/src/spambayes/scripts/sb_imapfilter.py", line 831, in __getitem__ data = self.imap_server.extract_fetch_data(response_data) File "/usr/home/dave/src/spambayes/scripts/sb_imapfilter.py", line 455, in extract_fetch_data msg_data = self._extract_fetch_data(msg) File "/usr/home/dave/src/spambayes/scripts/sb_imapfilter.py", line 428, in _extract_fetch_data raise BadIMAPResponseError("FETCH response", response) __main__.BadIMAPResponseError: The command 'FETCH response' failed to give an OK response. (' UID 1967)',) Rolling back to the last released version of spambayes makes this problem go away. -- Dave Abrahams Boost Consulting www.boost-consulting.com
David Abrahams <dave@boost-consulting.com> writes:
FYI, with the CVS HEAD as of 18 January:
Loading state from /usr/home/dave/hammie.new.db database /usr/home/dave/hammie.new.db is a new database Loading database /usr/home/dave/hammie.new.db... Done. Account: www.stlport.com:993 Training Training ham folder HamBox Traceback (most recent call last): File "/usr/home/dave/src/spambayes/scripts/sb_imapfilter.py", line 1283, in ? run() File "/usr/home/dave/src/spambayes/scripts/sb_imapfilter.py", line 1261, in run imap_filter.Train() File "/usr/home/dave/src/spambayes/scripts/sb_imapfilter.py", line 1004, in Train num_trained = folder.Train(self.classifier, is_spam) File "/usr/home/dave/src/spambayes/scripts/sb_imapfilter.py", line 888, in Train for msg in self: File "/usr/home/dave/src/spambayes/scripts/sb_imapfilter.py", line 799, in __iter__ yield self[key] File "/usr/home/dave/src/spambayes/scripts/sb_imapfilter.py", line 831, in __getitem__ data = self.imap_server.extract_fetch_data(response_data) File "/usr/home/dave/src/spambayes/scripts/sb_imapfilter.py", line 455, in extract_fetch_data msg_data = self._extract_fetch_data(msg) File "/usr/home/dave/src/spambayes/scripts/sb_imapfilter.py", line 428, in _extract_fetch_data raise BadIMAPResponseError("FETCH response", response) __main__.BadIMAPResponseError: The command 'FETCH response' failed to give an OK response. (' UID 1967)',)
Rolling back to the last released version of spambayes makes this problem go away.
Since there's been no response, I decided to try to debug this a little bit myself. I know little about the workings of IMAP, but the problem appears to be that sb_imapfilter isn't accounting for responses like this one: [('6 (BODY[] {3130}', 'Return-Path: <MAILER-DAEMON....'), ' UID 6)'] In particular, that last fragment is throwing it off. I don't know whether the real bug is in whatever gets passed to sb_imapfilter to be used as its "server" attribute, or whether its here. The following patch (which, given my scant knowledge, is almost certainly wrong) makes the problem disappear for me. I hope someone can at least follow up on this enough to tell me whether I need to learn more about IMAP ;-) Thanks, -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (1)
-
David Abrahams