From noreply at sourceforge.net Fri Dec 21 08:42:28 2007 From: noreply at sourceforge.net (SourceForge.net) Date: Thu, 20 Dec 2007 23:42:28 -0800 Subject: [spambayes-bugs] [ spambayes-Bugs-1653494 ] IMAP/RECENT problems Message-ID: Bugs item #1653494, was opened at 2007-02-06 13:04 Message generated for change (Comment added) made by david_abrahams You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=498103&aid=1653494&group_id=61702 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: imapfilter Group: 1.1.x Status: Open Resolution: None Priority: 5 Private: No Submitted By: David Abrahams (david_abrahams) Assigned to: Tony Meyer (anadelonbrin) Summary: IMAP/RECENT problems Initial Comment: I've now seen this problem with two different IMAP servers (Communigate and Cyrus) when trying to classify email. *Traceback (most recent call last): File "/usr/local/bin/sb_imapfilter.py", line 1289, in ? run() File "/usr/local/bin/sb_imapfilter.py", line 1271, in run imap_filter.Filter() File "/usr/local/bin/sb_imapfilter.py", line 1072, in Filter self.unsure_folder, self.ham_folder) File "/usr/local/bin/sb_imapfilter.py", line 975, in Filter msg.Save() File "/usr/local/bin/sb_imapfilter.py", line 728, in Save raise BadIMAPResponseError("recent", "Cannot find saved message") __main__.BadIMAPResponseError: The command 'recent' failed to give an OK response. Cannot find saved message I wonder if relying on the RECENT command is really such a good idea, as IIUC it's subject to all kinds of race conditions. ---------------------------------------------------------------------- >Comment By: David Abrahams (david_abrahams) Date: 2007-12-21 02:42 Message: Logged In: YES user_id=52572 Originator: YES New data: I found a reproducible case of this problem (on dovecot this time). After much analysis, I can say this much: 1. There's no RECENT command; this is an "idle loop" of NOOP commands that times out looking for some evidence that a message move has been completed by the server. 2. It occurs for me when a previously-unclassified message that didn't have a Message-Id header is first given an id with self._generate_id() and self.Save()d, then subsequently self.MoveTo()d a new folder and self.Save()d again. 3. If I comment out the first save on line 882 of sb_imapfilter.py, I don't see the problem, though I don't know if that's a proper fix 4. I have attached a patch that adds much more useful "verbose" info to sb_imapfilter.py, at least where debugging this problem is concerned. It also fixes a bug wherein classification would never move messages into a ham folder, even if one was specified. 5. Matt Stegman had some more data that might be useful in http://mail.python.org/pipermail/spambayes/2006-August/019611.html it occurs (at least) File Added: sb_imapfilter.py.patch ---------------------------------------------------------------------- Comment By: nicomatsu (nicomatsu) Date: 2007-02-20 13:36 Message: Logged In: YES user_id=1724434 Originator: NO I'm using Dovecot Mailserver and I have the same issue. I'm using spambayes-1.1a3. Traceback (most recent call last): File "/usr/bin/sb_imapfilter.py", line 1284, in ? run() File "/usr/bin/sb_imapfilter.py", line 1266, in run imap_filter.Filter() File "/usr/bin/sb_imapfilter.py", line 1067, in Filter self.unsure_folder, self.ham_folder) File "/usr/bin/sb_imapfilter.py", line 970, in Filter msg.Save() File "/usr/bin/sb_imapfilter.py", line 723, in Save raise BadIMAPResponseError("recent", "Cannot find saved message") __main__.BadIMAPResponseError: The command 'recent' failed to give an OK response. Cannot find saved message ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=498103&aid=1653494&group_id=61702