[Spambayes-checkins] spambayes/scripts sb_imapfilter.py,1.21,1.22

Tony Meyer anadelonbrin at projects.sourceforge.net
Tue Jan 27 03:36:54 EST 2004


Update of /cvsroot/spambayes/spambayes/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6805/scripts

Modified Files:
	sb_imapfilter.py 
Log Message:
Fix [ 870799 ] imap trying to fetch invalid message UID

Index: sb_imapfilter.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/scripts/sb_imapfilter.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** sb_imapfilter.py	19 Jan 2004 17:58:16 -0000	1.21
--- sb_imapfilter.py	27 Jan 2004 08:36:51 -0000	1.22
***************
*** 449,452 ****
--- 449,467 ----
          self._check(response, 'search')
          new_id = response[1][0]
+ 
+         # See [ 870799 ] imap trying to fetch invalid message UID
+         # It seems that although the save gave a "NO" response to the
+         # first save, the message was still saved (without the flags,
+         # probably).  This isn't really good behaviour on the server's
+         # part, but, as usual, we try and deal with it.  So, if we get
+         # more than one undeleted message with the same SpamBayes id,
+         # delete all of them apart from the last one, and use that.
+         multiple_ids = new_id.split()
+         for id_to_remove in multiple_ids[:-1]:
+             response = imap.uid("STORE", id_to_remove, "+FLAGS.SILENT",
+                                 "(\\Deleted \\Seen)")
+             self._check(response, 'store')
+         new_id = multiple_ids[-1]
+         
          # Let's hope it doesn't, but, just in case, if the search
          # turns up empty, we make the assumption that the new




More information about the Spambayes-checkins mailing list