[Spambayes] Trouble with the IMAP filter

Michael C. Neel neel at mediapulse.com
Wed May 12 09:42:36 EDT 2004


Here are the results from a run of sb 1.0rc1.  I had 3 messages (obvious spams) in INBOX,
and nothing in any of the training folders.  Both db files existed prior to running.  
The result was INBOX had 2 copies of each message, one deleted with a spambayes ID only added
to the header, the other looked to be the original message untouched (no sb headers added).
A copy was also placed in INBOX.SPAM: Spam, with all the normal sb headers added.

Not in the logs below, but because the messages were still in the INBOX folder I reran the sb_imapfilter
a few more times.  It did not recheck the existing messages, unless I had opened them in my client (evolution).
I presume this is because evolution adds it's own headers to a message, possible changing the message id,
and sb saw it as new.

Thanks,
Mike

[neel at mike nel]$ cat bayescustomize.ini
[imap]
password:xxxxxx
server:xxxxxxx
username:xxxxxxx
spam_folder:INBOX.SPAM: Spam
unsure_folder:INBOX.SPAM: Suspects
ham_train_folders:INBOX.SPAM: Train As Good
spam_train_folders:INBOX.SPAM: Train As Bad
filter_folders:INBOX
[Headers]
include_score:True
[Storage]
messageinfo_storage_file:/home/neel/sb/nel/spambayes.messageinfo.db
persistent_storage_file:/home/neel/sb/nel/hammie.db


[neel at mike nel]$ sb_imapfilter.py -c -t -v -i4
SpamBayes IMAP Filter Version 0.4 (May 2004)
and engine SpamBayes Engine Version 0.3 (January 2004).
 
Loading state from /home/neel/sb/nel/hammie.db database
/home/neel/sb/nel/hammie.db is an existing database, with 99 spam and 58 ham
Loading database /home/neel/sb/nel/hammie.db... Done.
  26:05.61 > DEN1 LOGIN "xxxxxx" "xxxxxx"
  26:05.73 < DEN1 OK LOGIN Ok.
Training
  26:05.73 > DEN2 SELECT "INBOX.SPAM: Train As Good"
  26:05.83 < * FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
  26:05.83 < * OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited
  26:05.83 < * 0 EXISTS
  26:05.83 < * 0 RECENT
  26:05.83 < * OK [UIDVALIDITY 1083954692] Ok
  26:05.83 < DEN2 OK [READ-WRITE] Ok
   Training ham folder INBOX.SPAM: Train As Good
  26:05.83 > DEN3 UID SEARCH UNDELETED
  26:05.93 < * SEARCH
  26:05.93 < DEN3 OK SEARCH done.
       0 trained.
  26:05.93 > DEN4 SELECT "INBOX.SPAM: Train As Bad"
  26:06.04 < * FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
  26:06.04 < * OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited
  26:06.04 < * 0 EXISTS
  26:06.04 < * 0 RECENT
  26:06.04 < * OK [UIDVALIDITY 1083954674] Ok
  26:06.04 < DEN4 OK [READ-WRITE] Ok
   Training spam folder INBOX.SPAM: Train As Bad
  26:06.04 > DEN5 UID SEARCH UNDELETED
  26:06.14 < * SEARCH
  26:06.14 < DEN5 OK SEARCH done.
       0 trained.
Training took 0.4091 seconds, 0 messages were trained
Classifying
  26:06.14 > DEN6 SELECT "INBOX.SPAM: Spam"
  26:06.24 < * FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
  26:06.24 < * OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited
  26:06.24 < * 41 EXISTS
  26:06.24 < * 0 RECENT
  26:06.24 < * OK [UIDVALIDITY 1083954645] Ok
  26:06.24 < DEN6 OK [READ-WRITE] Ok
  26:06.24 > DEN7 SELECT "INBOX.SPAM: Suspects"
  26:06.35 < * FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
  26:06.35 < * OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited
  26:06.35 < * 0 EXISTS
  26:06.35 < * 0 RECENT
  26:06.35 < * OK [UIDVALIDITY 1083955260] Ok
  26:06.35 < DEN7 OK [READ-WRITE] Ok
  26:06.35 > DEN8 SELECT INBOX
  26:06.45 < * FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
  26:06.45 < * OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited
  26:06.45 < * 3 EXISTS
  26:06.45 < * 0 RECENT
  26:06.45 < * OK [UIDVALIDITY 1019510577] Ok
  26:06.45 < DEN8 OK [READ-WRITE] Ok
  26:06.45 > DEN9 UID SEARCH UNDELETED
  26:06.55 < * SEARCH 14891 14892 14893
  26:06.55 < DEN9 OK SEARCH done.
  26:06.55 > DEN10 UID FETCH 14891 RFC822.HEADER
  26:06.66 < * 1 FETCH (UID 14891 RFC822.HEADER {688}
  26:06.66 read literal size 688
  26:06.66 < )
  26:06.66 < DEN10 OK FETCH completed.
  26:06.66 > DEN11 UID FETCH 14891 (BODY.PEEK[])
  26:06.77 < * 1 FETCH (UID 14891 BODY[] {5459}
  26:06.77 read literal size 5459
  26:06.95 < )
  26:06.95 < DEN11 OK FETCH completed.
  26:06.95 > DEN12 UID FETCH 14891 (FLAGS INTERNALDATE)
  26:07.05 < * 1 FETCH (UID 14891 FLAGS () INTERNALDATE "11-May-2004 22:47:26 -0400")
  26:07.05 < DEN12 OK FETCH completed.
  26:07.06 > DEN13 APPEND INBOX "11-May-2004 22:47:26 -0400" {5484}
  26:07.16 < + OK
  26:07.16 write literal size 5484
  26:07.42 < DEN13 OK [APPENDUID 1019510577 14894] APPEND Ok.
  26:07.42 > DEN14 UID STORE 14891 +FLAGS.SILENT (\Deleted \Seen)
  26:07.52 < DEN14 OK STORE completed.
  26:07.52 untagged responses dump:
                EXISTS: "3"
                PERMANENTFLAGS: "(\* \Draft \Answered \Flagged \Deleted \Seen)"
                READ-WRITE: ""
                FLAGS: "(\Draft \Answered \Flagged \Deleted \Seen \Recent)"
                APPENDUID: "1019510577 14894"
                UIDVALIDITY: "1019510577"
                RECENT: "0"
  26:07.52 > DEN15 NOOP
  26:07.62 < * 4 EXISTS
  26:07.62 < * 0 RECENT
  26:07.62 < DEN15 OK NOOP completed
  26:07.62 > DEN16 UID SEARCH (UNDELETED HEADER X-Spambayes-MailId 1084368366)
  26:07.72 < * SEARCH 14894
  26:07.72 < DEN16 OK SEARCH done.
  26:07.86 > DEN17 UID FETCH 14894 (FLAGS INTERNALDATE)
  26:07.96 < * 4 FETCH (UID 14894 FLAGS () INTERNALDATE "11-May-2004 22:47:26 -0400")
  26:07.96 < DEN17 OK FETCH completed.
  26:07.97 > DEN18 APPEND "INBOX.SPAM: Spam" "11-May-2004 22:47:26 -0400" {5554}
  26:08.07 < + OK
  26:08.07 write literal size 5554
  26:08.33 < DEN18 OK [APPENDUID 1083954645 339] APPEND Ok.
  26:08.33 > DEN19 UID STORE 14894 +FLAGS.SILENT (\Deleted \Seen)
  26:08.43 < DEN19 OK STORE completed.
  26:08.43 untagged responses dump:
                EXISTS: "3" "4"
                PERMANENTFLAGS: "(\* \Draft \Answered \Flagged \Deleted \Seen)"
                READ-WRITE: ""
                FLAGS: "(\Draft \Answered \Flagged \Deleted \Seen \Recent)"
                APPENDUID: "1019510577 14894" "1083954645 339"
                UIDVALIDITY: "1019510577"
                RECENT: "0" "0"
  26:08.43 > DEN20 NOOP
  26:08.53 < DEN20 OK NOOP completed
  26:08.53 > DEN21 SELECT "INBOX.SPAM: Spam"
  26:08.64 < * FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
  26:08.64 < * OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited
  26:08.64 < * 42 EXISTS
  26:08.64 < * 0 RECENT
  26:08.64 < * OK [UIDVALIDITY 1083954645] Ok
  26:08.64 < DEN21 OK [READ-WRITE] Ok
  26:08.64 > DEN22 UID SEARCH (UNDELETED HEADER X-Spambayes-MailId 1084368366)
  26:08.78 < * SEARCH 339
  26:08.78 < DEN22 OK SEARCH done.
  26:08.78 > DEN23 SELECT INBOX
  26:08.88 < * FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
  26:08.88 < * OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited
  26:08.88 < * 4 EXISTS
  26:08.88 < * 0 RECENT
  26:08.88 < * OK [UIDVALIDITY 1019510577] Ok
  26:08.88 < DEN23 OK [READ-WRITE] Ok
  26:08.88 > DEN24 UID FETCH 14892 RFC822.HEADER
  26:08.99 < * 2 FETCH (UID 14892 RFC822.HEADER {566}
  26:08.99 read literal size 566
  26:08.99 < )
  26:08.99 < DEN24 OK FETCH completed.
  26:08.99 > DEN25 UID FETCH 14892 (BODY.PEEK[])
  26:09.09 < * 2 FETCH (UID 14892 BODY[] {4682}
  26:09.09 read literal size 4682
  26:09.26 < )
  26:09.26 < DEN25 OK FETCH completed.
  26:09.26 > DEN26 UID FETCH 14892 (FLAGS INTERNALDATE)
  26:09.36 < * 2 FETCH (UID 14892 FLAGS () INTERNALDATE "11-May-2004 23:05:02 -0400")
  26:09.36 < DEN26 OK FETCH completed.
  26:09.37 > DEN27 APPEND INBOX "11-May-2004 23:05:02 -0400" {4716}
  26:09.47 < + OK
  26:09.47 write literal size 4716
  26:09.73 < DEN27 OK [APPENDUID 1019510577 14895] APPEND Ok.
  26:09.73 > DEN28 UID STORE 14892 +FLAGS.SILENT (\Deleted \Seen)
  26:09.84 < DEN28 OK STORE completed.
  26:09.84 untagged responses dump:
                EXISTS: "4"
                PERMANENTFLAGS: "(\* \Draft \Answered \Flagged \Deleted \Seen)"
                READ-WRITE: ""
                FLAGS: "(\Draft \Answered \Flagged \Deleted \Seen \Recent)"
                APPENDUID: "1019510577 14895"
                UIDVALIDITY: "1019510577"
                RECENT: "0"
  26:09.84 > DEN29 NOOP
  26:09.94 < * 5 EXISTS
  26:09.94 < * 0 RECENT
  26:09.94 < DEN29 OK NOOP completed
  26:09.94 > DEN30 UID SEARCH (UNDELETED HEADER X-Spambayes-MailId 1084368368)
  26:10.04 < * SEARCH 14895
  26:10.04 < DEN30 OK SEARCH done.
  26:10.10 > DEN31 UID FETCH 14895 (FLAGS INTERNALDATE)
  26:10.20 < * 5 FETCH (UID 14895 FLAGS () INTERNALDATE "11-May-2004 23:05:02 -0400")
  26:10.20 < DEN31 OK FETCH completed.
  26:10.21 > DEN32 APPEND "INBOX.SPAM: Spam" "11-May-2004 23:05:02 -0400" {4786}
  26:10.31 < + OK
  26:10.31 write literal size 4786
  26:10.58 < DEN32 OK [APPENDUID 1083954645 340] APPEND Ok.
  26:10.58 > DEN33 UID STORE 14895 +FLAGS.SILENT (\Deleted \Seen)
  26:10.68 < DEN33 OK STORE completed.
  26:10.68 untagged responses dump:
                EXISTS: "4" "5"
                PERMANENTFLAGS: "(\* \Draft \Answered \Flagged \Deleted \Seen)"
                READ-WRITE: ""
                FLAGS: "(\Draft \Answered \Flagged \Deleted \Seen \Recent)"
                APPENDUID: "1019510577 14895" "1083954645 340"
                UIDVALIDITY: "1019510577"
                RECENT: "0" "0"
  26:10.68 > DEN34 NOOP
  26:10.78 < DEN34 OK NOOP completed
  26:10.78 > DEN35 SELECT "INBOX.SPAM: Spam"
  26:10.89 < * FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
  26:10.89 < * OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited
  26:10.89 < * 43 EXISTS
  26:10.89 < * 0 RECENT
  26:10.89 < * OK [UIDVALIDITY 1083954645] Ok
  26:10.89 < DEN35 OK [READ-WRITE] Ok
  26:10.89 > DEN36 UID SEARCH (UNDELETED HEADER X-Spambayes-MailId 1084368368)
  26:11.03 < * SEARCH 340
  26:11.03 < DEN36 OK SEARCH done.
  26:11.03 > DEN37 SELECT INBOX
  26:11.13 < * FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
  26:11.13 < * OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited
  26:11.13 < * 5 EXISTS
  26:11.13 < * 0 RECENT
  26:11.13 < * OK [UIDVALIDITY 1019510577] Ok
  26:11.13 < DEN37 OK [READ-WRITE] Ok
  26:11.13 > DEN38 UID FETCH 14893 RFC822.HEADER
  26:11.25 < * 3 FETCH (UID 14893 RFC822.HEADER {683}
  26:11.25 read literal size 683
  26:11.25 < )
  26:11.25 < DEN38 OK FETCH completed.
  26:11.25 > DEN39 UID FETCH 14893 (BODY.PEEK[])
  26:11.35 < * 3 FETCH (UID 14893 BODY[] {13586}
  26:11.35 read literal size 13586
  26:11.94 < )
  26:11.94 < DEN39 OK FETCH completed.
  26:11.94 > DEN40 UID FETCH 14893 (FLAGS INTERNALDATE)
  26:12.08 < * 3 FETCH (UID 14893 FLAGS () INTERNALDATE "11-May-2004 23:54:36 -0400")
  26:12.08 < DEN40 OK FETCH completed.
  26:12.08 > DEN41 APPEND INBOX "11-May-2004 23:54:36 -0400" {13619}
  26:12.23 < + OK
  26:12.23 write literal size 13619
  26:12.70 < DEN41 OK [APPENDUID 1019510577 14896] APPEND Ok.
  26:12.70 > DEN42 UID STORE 14893 +FLAGS.SILENT (\Deleted \Seen)
  26:12.80 < DEN42 OK STORE completed.
  26:12.80 untagged responses dump:
                EXISTS: "5"
                PERMANENTFLAGS: "(\* \Draft \Answered \Flagged \Deleted \Seen)"
                READ-WRITE: ""
                FLAGS: "(\Draft \Answered \Flagged \Deleted \Seen \Recent)"
                APPENDUID: "1019510577 14896"
                UIDVALIDITY: "1019510577"
                RECENT: "0"
  26:12.80 > DEN43 NOOP
  26:12.90 < * 6 EXISTS
  26:12.91 < * 0 RECENT
  26:12.91 < DEN43 OK NOOP completed
  26:12.91 > DEN44 UID SEARCH (UNDELETED HEADER X-Spambayes-MailId 1084368371)
  26:13.01 < * SEARCH 14896
  26:13.01 < DEN44 OK SEARCH done.
  26:13.28 > DEN45 UID FETCH 14896 (FLAGS INTERNALDATE)
  26:13.38 < * 6 FETCH (UID 14896 FLAGS () INTERNALDATE "11-May-2004 23:54:36 -0400")
  26:13.38 < DEN45 OK FETCH completed.
  26:13.38 > DEN46 APPEND "INBOX.SPAM: Spam" "11-May-2004 23:54:36 -0400" {13689}
  26:13.49 < + OK
  26:13.49 write literal size 13689
  26:13.98 < DEN46 OK [APPENDUID 1083954645 341] APPEND Ok.
  26:13.98 > DEN47 UID STORE 14896 +FLAGS.SILENT (\Deleted \Seen)
  26:14.08 < DEN47 OK STORE completed.
  26:14.08 untagged responses dump:
                EXISTS: "5" "6"
                PERMANENTFLAGS: "(\* \Draft \Answered \Flagged \Deleted \Seen)"
                READ-WRITE: ""
                FLAGS: "(\Draft \Answered \Flagged \Deleted \Seen \Recent)"
                APPENDUID: "1019510577 14896" "1083954645 341"
                UIDVALIDITY: "1019510577"
                RECENT: "0" "0"
  26:14.08 > DEN48 NOOP
  26:14.18 < DEN48 OK NOOP completed
  26:14.18 > DEN49 SELECT "INBOX.SPAM: Spam"
  26:14.28 < * FLAGS (\Draft \Answered \Flagged \Deleted \Seen \Recent)
  26:14.28 < * OK [PERMANENTFLAGS (\* \Draft \Answered \Flagged \Deleted \Seen)] Limited
  26:14.28 < * 44 EXISTS
  26:14.28 < * 0 RECENT
  26:14.28 < * OK [UIDVALIDITY 1083954645] Ok
  26:14.28 < DEN49 OK [READ-WRITE] Ok
  26:14.28 > DEN50 UID SEARCH (UNDELETED HEADER X-Spambayes-MailId 1084368371)
  26:14.42 < * SEARCH 341
  26:14.42 < DEN50 OK SEARCH done.
***.
Classified 0 ham, 3 spam, and 0 unsure.
Classifying took 8.2868 seconds.
  26:14.42 > DEN51 LOGOUT
  26:14.53 < * BYE Courier-IMAP server shutting down
  26:14.53 BYE response: Courier-IMAP server shutting down
  26:14.53 < DEN51 OK LOGOUT completed
[neel at mike nel]$





More information about the Spambayes mailing list