[spambayes-bugs] [ spambayes-Bugs-788845 ] imapfilter training fails

SourceForge.net noreply at sourceforge.net
Mon Sep 1 19:05:12 EDT 2003


Bugs item #788845, was opened at 2003-08-15 05:37
Message generated for change (Comment added) made by anadelonbrin
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=788845&group_id=61702

Category: None
Group: None
>Status: Pending
>Resolution: Fixed
Priority: 5
Submitted By: Tys von Gaza (tvongaza)
>Assigned to: Tony Meyer (anadelonbrin)
Summary: imapfilter training fails

Initial Comment:
Using latest CVS, Python 2.2.2, connecting to a Courier 
IMAP server.  Web interface of imapfilter can connect 
and see the imap folders on the server.  When I try 
training (with messages in the TrainSpam folder) I get 
the following traceback, I am willing to help anyone 
debug this:

[gaza at games gaza]$ python2.2 
spambayes/imapfilter.py -v -t
SpamBayes IMAP Filter Alpha1, version 0.01 (May 2003),
using SpamBayes IMAP Filter Web Interface Alpha1, 
version 0.01
and engine SpamBayes Beta2, version 0.2 (July 2003).

Loading database hammie.db... Loading state from 
hammie.db database
hammie.db is an existing database, with 0 spam and 0 
ham
Done.
Training
   Training ham folder INBOX.SB.TrainHam
       0 trained.
   Training spam folder INBOX.SB.TrainSpam
*.Traceback (most recent call last):
  File "spambayes/imapfilter.py", line 782, in ?
    run()
  File "spambayes/imapfilter.py", line 768, in run
    imap_filter.Train()
  File "spambayes/imapfilter.py", line 607, in Train
    num_spam_trained = folder.Train(self.classifier, True)
  File "spambayes/imapfilter.py", line 543, in Train
    msg.Save()
  File "spambayes/imapfilter.py", line 365, in Save
    response = imap.uid("FETCH", self.uid, "(FLAGS 
INTERNALDATE)")
  File "//usr/lib/python2.2/imaplib.py", line 622, in uid
    typ, dat = apply(self._simple_command, (name, 
command) + args)
  File "//usr/lib/python2.2/imaplib.py", line 925, in 
_simple_command
    return self._command_complete(name, apply
(self._command, (name,) + args))
  File "//usr/lib/python2.2/imaplib.py", line 699, in 
_command
    data = '%s %s' % (data, self._checkquote(arg))
  File "//usr/lib/python2.2/imaplib.py", line 908, in 
_checkquote
    if (arg[0],arg[-1]) in (('(',')'),('"','"')):
IndexError: string index out of range

----------------------------------------------------------------------

>Comment By: Tony Meyer (anadelonbrin)
Date: 2003-09-02 13:05

Message:
Logged In: YES 
user_id=552329

I think I have fixed this.  If you could try out imapfilter in 
1.0a5 (due 04 Sept 03) and let me know if it works, that 
would be great.  It should definately move the error into 
smtpproxy, rather than imaplib, and it should manage to 
recover from it, as well.  It would be good to know that it still 
acts correctly though.

(IMAP is a terrible protocol.  The problem here is still the 
fundamental one that you can't alter a message on the 
server).

----------------------------------------------------------------------

Comment By: Tys von Gaza (tvongaza)
Date: 2003-08-25 19:19

Message:
Logged In: YES 
user_id=844717

Here is some more using a more verbose debug:

[gaza at games gaza]$ python2.2 spambayes/imapfilter.py -v -
t -i4
SpamBayes IMAP Filter Alpha1, version 0.01 (May 2003),
using SpamBayes IMAP Filter Web Interface Alpha1, version 
0.01
and engine SpamBayes Beta2, version 0.2 (July 2003).

Loading database hammie.db... Loading state from hammie.db 
database
hammie.db is an existing database, with 0 spam and 0 ham
Done.
  18:45.14 > FPNB1 LOGIN **** "******"
  18:45.19 < FPNB1 OK LOGIN Ok.
Training
  18:45.19 > FPNB2 SELECT INBOX.SB.TrainHam
  18:45.19 < * FLAGS (\Draft \Answered \Flagged \Deleted 
\Seen \Recent)
  18:45.19 < * OK [PERMANENTFLAGS (\* \Draft \Answered 
\Flagged \Deleted
\Seen)] Limited
  18:45.19 < * 1 EXISTS
  18:45.19 < * 0 RECENT
  18:45.19 < * OK [UIDVALIDITY 1060841558] Ok
  18:45.19 < FPNB2 OK [READ-WRITE] Ok
   Training ham folder INBOX.SB.TrainHam
  18:45.19 > FPNB3 UID SEARCH UNDELETED
  18:45.19 < * SEARCH 157
  18:45.19 < FPNB3 OK SEARCH done.
  18:45.19 > FPNB4 UID FETCH 157 RFC822.HEADER
  18:45.19 < * 1 FETCH (UID 157 RFC822.HEADER {2075}
  18:45.19 read literal size 2075
  18:45.19 < )
  18:45.19 < FPNB4 OK FETCH completed.
  18:45.20 > FPNB5 UID FETCH 157 RFC822.PEEK
  18:45.20 < FPNB5 NO Error in IMAP command received by 
server.
  18:45.20 NO response: Error in IMAP command received by 
server.
  18:45.20 > FPNB6 UID FETCH 157 RFC822
  18:45.20 < * 1 FETCH (UID 157 RFC822 {5442}
  18:45.20 read literal size 5442
  18:45.20 < )
  18:45.20 < FPNB6 OK FETCH completed.
  18:45.22 > FPNB7 UID FETCH 157 (FLAGS INTERNALDATE)
  18:45.22 < * 1 FETCH (UID 157 FLAGS (\Seen) 
INTERNALDATE "19-Aug-2003
10:07:21 -0600")
  18:45.23 < FPNB7 OK FETCH completed.
  18:45.24 > FPNB8 APPEND INBOX.SB.TrainHam (\Seen) "19-
Aug-2003 10:07:21
-0600" {5476}
  18:45.24 < + OK
  18:45.24 write literal size 5476
  18:45.29 < FPNB8 OK [APPENDUID 1060841558 158] APPEND 
Ok.
  18:45.29 > FPNB9 UID STORE 157 +FLAGS.SILENT (\Deleted)
  18:45.29 < FPNB9 OK STORE completed.
  18:45.29 > FPNB10 UID SEARCH (UNDELETED HEADER X-
Spambayes-MailId
1061320725)
  18:45.29 < * SEARCH
  18:45.29 < * 1 FETCH (FLAGS (\Seen \Deleted))
  18:45.29 < FPNB10 OK SEARCH done.
  18:45.29 > FPNB11 UID SEARCH RECENT
  18:45.29 < * SEARCH
  18:45.29 < FPNB11 OK SEARCH done.
*.Traceback (most recent call last):
  File "spambayes/imapfilter.py", line 782, in ?
    run()
  File "spambayes/imapfilter.py", line 768, in run
    imap_filter.Train()
  File "spambayes/imapfilter.py", line 594, in Train
    num_ham_trained = folder.Train(self.classifier, False)
  File "spambayes/imapfilter.py", line 543, in Train
    msg.Save()
  File "spambayes/imapfilter.py", line 365, in Save
    response = imap.uid("FETCH", self.uid, "(FLAGS 
INTERNALDATE)")
  File "//usr/lib/python2.2/imaplib.py", line 622, in uid
    typ, dat = apply(self._simple_command, (name, command) 
+ args)
  File "//usr/lib/python2.2/imaplib.py", line 925, in 
_simple_command
    return self._command_complete(name, apply
(self._command, (name,) + args))
  File "//usr/lib/python2.2/imaplib.py", line 699, in _command
    data = '%s %s' % (data, self._checkquote(arg))
  File "//usr/lib/python2.2/imaplib.py", line 908, in _checkquote
    if (arg[0],arg[-1]) in (('(',')'),('"','"')):
IndexError: string index out of range



----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2003-08-19 20:19

Message:
Logged In: YES 
user_id=552329

I have very occasionally seen this too, but whenever I've 
tried to reproduce it (to fix it) I haven't been able to.  Do you 
get this consistently?  If you do, could you run imapfilter with 
the "-i4" switch and tell me/the list what you get?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498103&aid=788845&group_id=61702



More information about the Spambayes-bugs mailing list