From anadelonbrin at users.sourceforge.net Sun Jul 4 02:19:44 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sun Jul 4 02:19:48 2004 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py,1.128,1.129 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26368/Outlook2000 Modified Files: addin.py Log Message: Add a time stamp to the logs - this would occasionally be useful in figuring out how old the logs are. Don't hook the spam folder unnecessarily. Fixes [ 933473 ] Unnecessary spam folder hook No need for this to be backported, since there really isn't any harm. I've been running with this change for a month and a half without problems, though, so it should be fine. Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.128 retrieving revision 1.129 diff -C2 -d -r1.128 -r1.129 *** addin.py 4 Mar 2004 03:13:44 -0000 1.128 --- addin.py 4 Jul 2004 06:19:40 -0000 1.129 *************** *** 402,407 **** self.manager.LogDebug(2, "OnItemAdd event for SPAM folder", self, "with item", item.Subject.encode("mbcs", "ignore")) ! if not self.manager.config.training.train_manual_spam: ! return # XXX - Theoretically we could get "not found" exception here, # but we have never guarded for it, and never seen it. If it does --- 402,407 ---- self.manager.LogDebug(2, "OnItemAdd event for SPAM folder", self, "with item", item.Subject.encode("mbcs", "ignore")) ! assert(not self.manager.config.training.train_manual_spam, ! "The folder shouldn't be hooked if this is False") # XXX - Theoretically we could get "not found" exception here, # but we have never guarded for it, and never seen it. If it does *************** *** 1205,1208 **** --- 1205,1212 ---- (major, minor, spack, ver_str) print "using Python", sys.version + from time import localtime + ltime = localtime() + print "Log created %s-%s-%s" % \ + (ltime[0], ltime[1], ltime[2]) self.explorers_events = None # create at OnStartupComplete *************** *** 1331,1335 **** ) # For spam manually moved ! if config.spam_folder_id: new_hooks.update( self._HookFolderEvents([config.spam_folder_id], --- 1335,1340 ---- ) # For spam manually moved ! if config.spam_folder_id and \ ! self.manager.config.training.train_manual_spam: new_hooks.update( self._HookFolderEvents([config.spam_folder_id], From anadelonbrin at users.sourceforge.net Fri Jul 9 01:51:27 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 9 01:51:31 2004 Subject: [Spambayes-checkins] spambayes/spambayes Version.py, 1.31.4.1, 1.31.4.2 __init__.py, 1.11.4.1, 1.11.4.2 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16386/spambayes Modified Files: Tag: release_1_0-branch Version.py __init__.py Log Message: Prepare for 1.0 (final). (I wonder whether all the version numbers in Version.py should be bumped to 1.0, but I'm not sure so I'll leave it alone and check with Mark later. I gather we're still planning to revamp this file in the future, anyway). Index: Version.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Version.py,v retrieving revision 1.31.4.1 retrieving revision 1.31.4.2 diff -C2 -d -r1.31.4.1 -r1.31.4.2 *** Version.py 23 Jun 2004 23:47:40 -0000 1.31.4.1 --- Version.py 8 Jul 2004 23:51:24 -0000 1.31.4.2 *************** *** 38,50 **** # "description" strings below - they just need to increment # so automated version checking works. ! # 0.99 indicates '1.0b/rc/' so will go 0.992 etc, until a real ! # 1.0, which can get 1.0 :) ! "Version": 0.993, ! "BinaryVersion": 0.993, "Description": "SpamBayes Outlook Addin", ! "Date": "June 2004", ! "Full Description": "%(Description)s Version 1.0rc2 (%(Date)s)", "Full Description Binary": ! "%(Description)s Binary Version 1.0rc2 (%(Date)s)", # Note this means we can change the download page later, and old # versions will still go to the new page. --- 38,48 ---- # "description" strings below - they just need to increment # so automated version checking works. ! "Version": 1.0, ! "BinaryVersion": 1.0, "Description": "SpamBayes Outlook Addin", ! "Date": "July 2004", ! "Full Description": "%(Description)s Version 1.0 (%(Date)s)", "Full Description Binary": ! "%(Description)s Binary Version 1.0 (%(Date)s)", # Note this means we can change the download page later, and old # versions will still go to the new page. *************** *** 55,65 **** # Note these version numbers also currently don't appear in the # "description" strings below - see above ! "Version": 0.6, ! "BinaryVersion": 0.6, "Description": "SpamBayes POP3 Proxy", ! "Date": "June 2004", ! "Full Description": """%(Description)s Version 1.0rc2 (%(Date)s)""", "Full Description Binary": ! """%(Description)s Binary Version 1.0rc2 (%(Date)s)""", # Note this means we can change the download page later, and old # versions will still go to the new page. --- 53,63 ---- # Note these version numbers also currently don't appear in the # "description" strings below - see above ! "Version": 1.0, ! "BinaryVersion": 1.0, "Description": "SpamBayes POP3 Proxy", ! "Date": "July 2004", ! "Full Description": """%(Description)s Version 1.0 (%(Date)s)""", "Full Description Binary": ! """%(Description)s Binary Version 1.0 (%(Date)s)""", # Note this means we can change the download page later, and old # versions will still go to the new page. Index: __init__.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/__init__.py,v retrieving revision 1.11.4.1 retrieving revision 1.11.4.2 diff -C2 -d -r1.11.4.1 -r1.11.4.2 *** __init__.py 23 Jun 2004 23:47:43 -0000 1.11.4.1 --- __init__.py 8 Jul 2004 23:51:24 -0000 1.11.4.2 *************** *** 1,3 **** # package marker. ! __version__ = '1.0rc2' --- 1,3 ---- # package marker. ! __version__ = '1.0' From anadelonbrin at users.sourceforge.net Fri Jul 9 02:25:26 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 9 02:25:29 2004 Subject: [Spambayes-checkins] website developer.ht,1.11,1.12 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25098 Modified Files: developer.ht Log Message: Wow, this is very out of date! Python 2.3 is no longer in beta... Use "SpamBayes" not "spambayes". Update the "what needs to be done" bit. Please everyone feel free to edit this to reflext what you think needs to be done. (Or maybe there should just be links to the wiki or spambayes-dev or the feature requests?) Index: developer.ht =================================================================== RCS file: /cvsroot/spambayes/website/developer.ht,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** developer.ht 7 Jul 2003 04:16:41 -0000 1.11 --- developer.ht 9 Jul 2004 00:25:23 -0000 1.12 *************** *** 6,10 ****

So you want to get involved?

Running the code

!

This project works with either Python 2.2.3, Python 2.3 (currently in beta), or on the bleeding edge of python code, available from CVS on --- 6,10 ----

So you want to get involved?

Running the code

!

This project works with either Python 2.2.3, Python 2.3, or on the bleeding edge of python code, available from CVS on *************** *** 16,20 **** sourceforge (you'll need version 2.4.3 or later).

!

The spambayes code itself is also available via CVS, or from the download page.

--- 16,20 ---- sourceforge (you'll need version 2.4.3 or later).

!

The SpamBayes code itself is also available via CVS, or from the download page.

*************** *** 30,42 ****

So what needs to be done

!

Currently (July) work is now being focused on improving deployment ! of the system (actually building the applications and the code so that ! Tim's sister <wink> can use the system), with the aim of eventually ! putting out a beta (or even full!) release. There is still a certain ! amount of interest in finding additional things that are beneficial to ! the tokenizer, although most people are pretty happy with how it works ! at the moment. The combining scheme is now pretty solid and pretty amazing. ! The other big body of work is monitoring the bug reports and feature requests ! that come in and trying to resolve those.

Collecting training data

--- 30,60 ----

So what needs to be done

!

In July 2004, the final 1.0 release was made. As a result, there are ! now two focuses. We would like to resolve any outstanding bugs in the 1.0 ! release, so that a 1.0.1 release (containing only bug fixes) can be ! released. At the same time, work has begun on a 1.1 release, which will ! contain much more than just bug releases.

! !

Each developer has their own pet ideas that they'd like to implement for ! 1.1, but there are a few general areas that you could work on if you're ! stuck for ideas:

!
    !
  • Internationalisation. A small number of people have expressed ! interest in translating the SpamBayes documentation and user interfaces ! into other languages. We're very happy for this to happen, but areas ! of the code need to be cleaned up to make this easier (and then there's ! the actual translation work).
  • !
  • Database backend. The majority of SpamBayes users use the bsddb ! support included with Python (a few use a pickled Python dict, and even ! fewer use the experimental mySQL/postgreSQL support). The bsddb ! solution is problematic, in that users' databases sometimes get ! corrupted, but we don't know what causes that. The general consensus ! is that (unless a bsddb expert comes along) we should move to an ! alternative database backend - perhaps ZOE/ZODB. Work on this would ! be appreciated by many.
  • !
! !

The other big body of work is monitoring the bug reports and feature ! requests that come in and trying to resolve those.

Collecting training data

From anadelonbrin at users.sourceforge.net Fri Jul 9 02:35:49 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 9 02:35:53 2004 Subject: [Spambayes-checkins] website applications.ht,1.29,1.30 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28378 Modified Files: applications.ht Log Message: The plug-in supports Outlook 2003. Move the notes about running from source lower down. I don't think many people (other than the developers) do this any more. Update from 1.0rc2 to 1.0. Windows should have a capital 'w'. Index: applications.ht =================================================================== RCS file: /cvsroot/spambayes/website/applications.ht,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** applications.ht 26 Jun 2004 06:57:06 -0000 1.29 --- applications.ht 9 Jul 2004 00:35:46 -0000 1.30 *************** *** 9,19 ****

Outlook

!

Sean True and Mark Hammond have developed an addin for Outlook (2000 and XP) that ! adds support for the SpamBayes classifier.

Requirements

  • Outlook 2000 or above (not Outlook Express)
!

If you are going to use a source code version, you will also need:

  • Python 2.2 or later (2.3 recommended)
  • --- 9,24 ----

    Outlook

    !

    Sean True and Mark Hammond have developed an addin for Outlook (2000 ! and above) that adds support for the SpamBayes classifier.

    Requirements

    • Outlook 2000 or above (not Outlook Express)
    ! !

    Availability

    !

    Mark has packaged together an installer for the plugin. ! Go to the Windows page for more.

    !

    Alternatively, to run from source, download the ! latest source archive. Note that you will also need:

    • Python 2.2 or later (2.3 recommended)
    • *************** *** 23,32 **** For more on this, see the README.txt or about.html file in the spambayes CVS repository's Outlook2000 directory. -

      - -

      Availability

      -

      Mark has packaged together an installer for the plugin. - Go to the Windows page for more.

      -

      Alternatively, to run from source, download 1.0 release candidate 2.

      Alternatively, you can use CVS to get the code - go to the CVS page on the project's sourceforge site for more.

      --- 28,31 ---- *************** *** 34,38 ****

      sb_filter is a command line tool for marking mail as ham or spam. The readme ! includes a guide to integrating it with your mailer (Unix-only instructions at the moment - additions welcome!). Currently it focuses on running sb_filter via procmail.

      --- 33,38 ----

      sb_filter is a command line tool for marking mail as ham or spam. The readme ! includes a guide to integrating it with your mailer (Unix-only ! instructions at the moment - additions welcome!). Currently it focuses on running sb_filter via procmail.

      *************** *** 44,48 ****

      Availability

      !

      Download 1.0 release candidate 2.

      Alternatively, use CVS to get the code - go to the CVS page on the project's sourceforge site for more.

      --- 44,48 ----

      Availability

      !

      Download the 1.0 source archive.

      Alternatively, use CVS to get the code - go to the CVS page on the project's sourceforge site for more.

      *************** *** 55,59 ****
      • Python 2.2 or later (2.3 recommended)
      • !
      • Should work on windows/unix/whatever...
      --- 55,59 ----
      • Python 2.2 or later (2.3 recommended)
      • !
      • Should work on Windows/unix/whatever...
      *************** *** 62,66 **** for a binary version of sb_server, including a tray application to access it.

      !

      Alternatively, to run from source, download 1.0 release candidate 1.

      Alternatively, use CVS to get the code - go to the CVS page on the project's sourceforge site for more.

      --- 62,67 ---- for a binary version of sb_server, including a tray application to access it.

      !

      Alternatively, to run from source, download the ! 1.0 source archive.

      Alternatively, use CVS to get the code - go to the CVS page on the project's sourceforge site for more.

      *************** *** 77,81 ****

      Availability

      !

      Download 1.0 release candidate 2.

      Alternatively, use CVS to get the code - go to the CVS page on the project's sourceforge site for more.

      --- 78,82 ----

      Availability

      !

      Download the 1.0 source archive.

      Alternatively, use CVS to get the code - go to the CVS page on the project's sourceforge site for more.

      *************** *** 93,97 ****

      Availability

      !

      Download 1.0 release candidate 2.

      Alternatively, use CVS to get the code - go to the CVS page on the project's sourceforge site for more.

      --- 94,98 ----

      Availability

      !

      Download the 1.0 source archive.

      Alternatively, use CVS to get the code - go to the CVS page on the project's sourceforge site for more.

      *************** *** 111,114 ****

      Availability

      !

      Download 1.0 release candidate 2.

      Alternatively, use CVS to get the code - go to the CVS page on the project's sourceforge site for more.

      --- 112,115 ----

      Availability

      !

      Download the 1.0 source archive.

      Alternatively, use CVS to get the code - go to the CVS page on the project's sourceforge site for more.

      From anadelonbrin at users.sourceforge.net Fri Jul 9 02:37:36 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 9 02:37:39 2004 Subject: [Spambayes-checkins] website background.ht,1.18,1.19 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28907 Modified Files: background.ht Log Message: Capital 'p' for Python. Add reference to Gary's Linux Journal article. Some wrapping to fit in 80 chars more nicely. Index: background.ht =================================================================== RCS file: /cvsroot/spambayes/website/background.ht,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** background.ht 14 Dec 2003 04:12:32 -0000 1.18 --- background.ht 9 Jul 2004 00:37:25 -0000 1.19 *************** *** 9,16 ****
      • The paper that started the ball rolling: ! Paul Graham's A Plan for Spam.
      • Gary Robinson has an interesting essay ! suggesting some improvements to Graham's original approach.

      more links? mail --- 9,19 ----

      more links? mail *************** *** 18,22 ****

      Overall Approach

      !

      Please note that I (Anthony) am writing this based on memory and limited understanding of some of the subtler points of the maths. Gentle corrections are welcome, or even encouraged.

      Tokenizing

      --- 21,27 ----

      Overall Approach

      !

      Please note that I (Anthony) am writing this based on ! memory and limited understanding of some of the subtler points of the maths. ! Gentle corrections are welcome, or even encouraged.

      Tokenizing

      *************** *** 252,256 ****

      Tim Peters has whacked a whole lot of useful information into CVS commit messages. As the project was moved from an obscure corner of the ! python CVS tree, there's actually two sources of CVS commits.

        --- 257,261 ----

        Tim Peters has whacked a whole lot of useful information into CVS commit messages. As the project was moved from an obscure corner of the ! Python CVS tree, there's actually two sources of CVS commits.

          From anadelonbrin at users.sourceforge.net Fri Jul 9 02:39:23 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 9 02:39:25 2004 Subject: [Spambayes-checkins] website docs.ht,1.18,1.19 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29498 Modified Files: docs.ht Log Message: The FAQs aren't so rudimentary any more. Spambayes -> SpamBayes Index: docs.ht =================================================================== RCS file: /cvsroot/spambayes/website/docs.ht,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** docs.ht 20 Oct 2003 22:41:56 -0000 1.18 --- docs.ht 9 Jul 2004 00:39:20 -0000 1.19 *************** *** 5,9 ****

          Project documentation

            !
          • A rudimentary set of Frequently Asked Questions (FAQ).
          • The SpamBayes wiki exists to let the users and developers of SpamBayes cooperate to develop documentation, share tips and recipes, --- 5,9 ----

            Project documentation

              !
            • A set of Frequently Asked Questions (FAQ).
            • The SpamBayes wiki exists to let the users and developers of SpamBayes cooperate to develop documentation, share tips and recipes, *************** *** 51,55 **** that you asked for, just anything that's not unsolicited bulk email. There is a second use for the term which means an email message which ! Spambayes classified as good email. That doesn't mean it's so, just that based upon the evidence provided to the classifier it looked like good email. (See also: spam, unsure.) --- 51,55 ---- that you asked for, just anything that's not unsolicited bulk email. There is a second use for the term which means an email message which ! SpamBayes classified as good email. That doesn't mean it's so, just that based upon the evidence provided to the classifier it looked like good email. (See also: spam, unsure.) *************** *** 64,68 **** definition deliberately excludes viruses and those stupid jokes sent to you by your Aunt Tillie. There is a second use for the term which ! means an email message which Spambayes classified as bad email. That doesn't mean it's so, just that based upon the evidence provided to the classifier it looked like bad email. (See also: ham, unsure.) --- 64,68 ---- definition deliberately excludes viruses and those stupid jokes sent to you by your Aunt Tillie. There is a second use for the term which ! means an email message which SpamBayes classified as bad email. That doesn't mean it's so, just that based upon the evidence provided to the classifier it looked like bad email. (See also: ham, unsure.) From anadelonbrin at users.sourceforge.net Fri Jul 9 02:40:53 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 9 02:40:59 2004 Subject: [Spambayes-checkins] website index.ht,1.34,1.35 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29958 Modified Files: index.ht Log Message: Update for 1.0. Please don't do any "make install"s for the moment - I'll do that once Mark and I finish getting 1.0 all done. Index: index.ht =================================================================== RCS file: /cvsroot/spambayes/website/index.ht,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** index.ht 26 Jun 2004 06:57:07 -0000 1.34 --- index.ht 9 Jul 2004 00:40:50 -0000 1.35 *************** *** 5,10 ****

              News

              !

              The second Version 1.0 release candidate (both source and Windows ! binary installer) is now available!

              See the download page for more.

              You may also like to see what other people have --- 5,10 ----

              News

              !

              SpamBayes 1.0 is now available! (This includes both the source ! archives and a Windows binary installer).

              See the download page for more.

              You may also like to see what other people have *************** *** 138,143 ****

              The code is currently available from a variety of methods from the ! downloads page. The current release is ! 1.0alpha9 (0.9).

              --- 138,142 ----

              The code is currently available from a variety of methods from the ! downloads page.

              From anadelonbrin at users.sourceforge.net Fri Jul 9 02:42:55 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 9 02:42:57 2004 Subject: [Spambayes-checkins] website reply.txt,1.14,1.15 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30664 Modified Files: reply.txt Log Message: Update for 1.0. Index: reply.txt =================================================================== RCS file: /cvsroot/spambayes/website/reply.txt,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** reply.txt 26 Jun 2004 06:57:07 -0000 1.14 --- reply.txt 9 Jul 2004 00:42:53 -0000 1.15 *************** *** 48,53 **** ----------------------------------------------- ! Please ensure that you have the latest version. As of 2004-06-26, this is ! 1.0rc2 for both the source and for the binary installer (for the Outlook plug-in and sb_server). If you are still having trouble, try looking at the bug reports that are currently open: --- 48,53 ---- ----------------------------------------------- ! Please ensure that you have the latest version. As of 2004-07-09, this is ! 1.0 for both the source and for the binary installer (for the Outlook plug-in and sb_server). If you are still having trouble, try looking at the bug reports that are currently open: From anadelonbrin at users.sourceforge.net Fri Jul 9 05:24:51 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 9 05:24:55 2004 Subject: [Spambayes-checkins] spambayes/spambayes/test test_storage.py, 1.5, 1.6 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4865/spambayes/test Modified Files: test_storage.py Log Message: Update test to reflect (current) correct way to call open_storage. Fixes part of [ 981970 ] tests failing Index: test_storage.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/test/test_storage.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_storage.py 24 Dec 2003 17:16:38 -0000 1.5 --- test_storage.py 9 Jul 2004 03:24:48 -0000 1.6 *************** *** 152,156 **** try: try: ! open_storage(db_name, True) except SystemExit: pass --- 152,156 ---- try: try: ! open_storage(db_name, "dbm") except SystemExit: pass From anadelonbrin at users.sourceforge.net Fri Jul 9 11:26:24 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 9 11:26:27 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_server.py,1.21,1.22 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22512/scripts Modified Files: sb_server.py Log Message: Drat. Using -u on the command line with sb_server hasn't worked for a while (Hmm...I guess the tests should be *run* occasionally, too!). We need to set these options in the constructor, not in init(), because init gets called after we load in the command line args. This does mean that any changes to the option values need to be also updated in state, or a new state has to be made, rather than calling init(), but I believe we always do this anyway. In addition, most of these are values that only really apply to starting up from the command line. Fixes part of [ 981970 ] tests failing Index: sb_server.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_server.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** sb_server.py 16 Mar 2004 05:08:31 -0000 1.21 --- sb_server.py 9 Jul 2004 09:26:21 -0000 1.22 *************** *** 640,643 **** --- 640,651 ---- self.init() + # Load up the other settings from Option.py / bayescustomize.ini + self.uiPort = options["html_ui", "port"] + self.launchUI = options["html_ui", "launch_browser"] + self.gzipCache = options["Storage", "cache_use_gzip"] + self.cacheExpiryDays = options["Storage", "cache_expiry_days"] + self.runTestServer = False + self.isTest = False + def init(self): assert not self.prepared, "init after prepare, but before close" *************** *** 664,675 **** sys.exit() - # Load up the other settings from Option.py / bayescustomize.ini - self.uiPort = options["html_ui", "port"] - self.launchUI = options["html_ui", "launch_browser"] - self.gzipCache = options["Storage", "cache_use_gzip"] - self.cacheExpiryDays = options["Storage", "cache_expiry_days"] - self.runTestServer = False - self.isTest = False - # Set up the statistics. self.totalSessions = 0 --- 672,675 ---- From montanaro at users.sourceforge.net Sat Jul 10 04:59:44 2004 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Sat Jul 10 04:59:47 2004 Subject: [Spambayes-checkins] spambayes/contrib tte.py,1.10,1.11 Message-ID: Update of /cvsroot/spambayes/spambayes/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2443 Modified Files: tte.py Log Message: 2.3 compatibility: add reversed() function When deciding if messages are misses or not, consider whether they have Message-Id or Subject headers. If they have neither, there's probably something funky going on. In that case, just ignore them altogether. Maybe it's not the best approach, but it's the best I've come up with so far until I figure out what the heck's going on. Index: tte.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/contrib/tte.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tte.py 28 Jun 2004 13:22:58 -0000 1.10 --- tte.py 10 Jul 2004 02:59:41 -0000 1.11 *************** *** 83,86 **** --- 83,94 ---- print >> sys.stderr, __doc__.strip() % globals() + try: + reversed + except NameError: + def reversed(seq): + seq = seq[:] + seq.reverse() + return iter(seq) + def train(store, ham, spam, maxmsgs, maxrounds, tdict, reverse, verbose): smisses = hmisses = round = 0 *************** *** 111,125 **** score = store.spamprob(tokenize(hammsg)) ! if score > ham_cutoff: if verbose: ! selector = (hammsg["message-id"] or ! hammsg["subject"]) ! if selector is None: ! print >> sys.stderr, "-"*25 ! print >> sys.stderr, mboxutils.as_string(hammsg) ! print >> sys.stderr, "-"*25 ! else: ! print >> sys.stderr, "miss ham: %.6f %s" % ( ! score, selector) hmisses += 1 tdict[hammsg["message-id"]] = True --- 119,128 ---- score = store.spamprob(tokenize(hammsg)) ! selector = (hammsg["message-id"] or ! hammsg["subject"]) ! if score > ham_cutoff and selector is not None: if verbose: ! print >> sys.stderr, "miss ham: %.6f %s" % ( ! score, selector) hmisses += 1 tdict[hammsg["message-id"]] = True *************** *** 127,141 **** score = store.spamprob(tokenize(spammsg)) ! if score < spam_cutoff: if verbose: ! selector = (spammsg["message-id"] or ! spammsg["subject"]) ! if selector is None: ! print >> sys.stderr, "-"*25 ! print >> sys.stderr, mboxutils.as_string(spammsg) ! print >> sys.stderr, "-"*25 ! else: ! print >> sys.stderr, "miss spam: %.6f %s" % ( ! score, selector) smisses += 1 tdict[spammsg["message-id"]] = True --- 130,139 ---- score = store.spamprob(tokenize(spammsg)) ! selector = (spammsg["message-id"] or ! spammsg["subject"]) ! if score < spam_cutoff and selector is not None: if verbose: ! print >> sys.stderr, "miss spam: %.6f %s" % ( ! score, selector) smisses += 1 tdict[spammsg["message-id"]] = True From anadelonbrin at users.sourceforge.net Wed Jul 14 09:06:42 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Jul 14 09:06:45 2004 Subject: [Spambayes-checkins] spambayes/spambayes/test test_programs.py, 1.3, 1.4 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29444/spambayes/test Modified Files: test_programs.py Log Message: Fix typo. Index: test_programs.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/test/test_programs.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_programs.py 16 Dec 2003 05:06:34 -0000 1.3 --- test_programs.py 14 Jul 2004 07:06:40 -0000 1.4 *************** *** 158,162 **** self.failUnless(not spawner.is_running(), "didn't stop after stop") self.failUnless(not is_any_sb_server_running(), ! "Platform mutex still help after stop") def test_sb_server_default(self): # Should be using the default port from the options file. --- 158,162 ---- self.failUnless(not spawner.is_running(), "didn't stop after stop") self.failUnless(not is_any_sb_server_running(), ! "Platform mutex still held after stop") def test_sb_server_default(self): # Should be using the default port from the options file. From anadelonbrin at users.sourceforge.net Wed Jul 14 09:07:24 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Jul 14 09:07:27 2004 Subject: [Spambayes-checkins] spambayes/spambayes/test sb_test_support.py, 1.2, 1.3 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29700/spambayes/test Modified Files: sb_test_support.py Log Message: Fix strange capitalisation. Index: sb_test_support.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/test/sb_test_support.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sb_test_support.py 16 Dec 2003 05:06:34 -0000 1.2 --- sb_test_support.py 14 Jul 2004 07:07:22 -0000 1.3 *************** *** 23,27 **** os.path.join(this_dir, "..", "..")) sys.path.insert(0, sb_dir) ! import SpamBayes.Version # Now do the same for the sb_* scripts --- 23,27 ---- os.path.join(this_dir, "..", "..")) sys.path.insert(0, sb_dir) ! import spambayes.Version # Now do the same for the sb_* scripts From anadelonbrin at users.sourceforge.net Wed Jul 14 09:08:54 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Jul 14 09:08:57 2004 Subject: [Spambayes-checkins] spambayes/spambayes message.py,1.50,1.51 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30166/spambayes Modified Files: message.py Log Message: Deprecate a function that breaks with Python 2.4a1 Index: message.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/message.py,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** message.py 13 May 2004 22:01:28 -0000 1.50 --- message.py 14 Jul 2004 07:08:51 -0000 1.51 *************** *** 242,245 **** --- 242,250 ---- # imapfilter has an example of this in action def setPayload(self, payload): + """DEPRECATED. + + This function does not work (as a result of using private + methods in a hackish way) in Python 2.4, so is now deprecated. + Use *_from_string as described above.""" prs = email.Parser.Parser() fp = StringIO(payload) From anadelonbrin at users.sourceforge.net Wed Jul 14 09:11:11 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Jul 14 09:11:14 2004 Subject: [Spambayes-checkins] spambayes/spambayes classifier.py,1.23,1.24 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30909/spambayes Modified Files: classifier.py Log Message: Update a comment. When slurping, use a lower timeout so things work faster (with Python >=2.3) Avoid using message.setPayload, as this is now deprecated (doesn't work with Python 2.4a1). Use the new form of makeMessage instead. Index: classifier.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/classifier.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** classifier.py 6 Feb 2004 21:43:00 -0000 1.23 --- classifier.py 14 Jul 2004 07:11:08 -0000 1.24 *************** *** 527,533 **** 'synthetic' tokens get bigram'ed, too. ! The bigram token is simply "unigram1 unigram2" - a space should be sufficient as a separator, since spaces aren't in any other ! tokens, apart from 'synthetic' ones. If the experimental "Classifier":"x-use_bigrams" option is --- 527,536 ---- 'synthetic' tokens get bigram'ed, too. ! The bigram token is simply "bi:unigram1 unigram2" - a space should be sufficient as a separator, since spaces aren't in any other ! tokens, apart from 'synthetic' ones. The "bi:" prefix is added ! to avoid conflict with tokens we generate (like "subject: word", ! which could be "word" in a subject, or a bigram of "subject:" and ! "word"). If the experimental "Classifier":"x-use_bigrams" option is *************** *** 686,689 **** --- 689,701 ---- return ["url:non_html"] + # Waiting for the default timeout period slows everything + # down far too much, so try and reduce it for just this + # call (this will only work with Python 2.3 and above). + try: + timeout = socket.getdefaulttimeout() + socket.setdefaulttimeout(5) + except AttributeError: + # Probably Python 2.2. + pass try: if options["globals", "verbose"]: *************** *** 697,700 **** --- 709,718 ---- self.bad_urls["url:unknown_error"] += (url,) return ["url:unknown_error"] + # Restore the timeout + try: + socket.setdefaulttimeout(timeout) + except AttributeError: + # Probably Python 2.2. + pass # Anything that isn't text/html is ignored *************** *** 712,717 **** # Retrieving the same messages over and over again will tire # us out, so we store them in our own wee cache. ! message = self.urlCorpus.makeMessage(url_key) ! message.setPayload(fake_message_string) self.urlCorpus.addMessage(message) else: --- 730,735 ---- # Retrieving the same messages over and over again will tire # us out, so we store them in our own wee cache. ! message = self.urlCorpus.makeMessage(url_key, ! fake_message_string) self.urlCorpus.addMessage(message) else: From anadelonbrin at users.sourceforge.net Wed Jul 14 09:15:40 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Jul 14 09:15:42 2004 Subject: [Spambayes-checkins] spambayes/spambayes Corpus.py, 1.19, 1.20 FileCorpus.py, 1.11, 1.12 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31771/spambayes Modified Files: Corpus.py FileCorpus.py Log Message: Allow makeMessage to take a content parameter, which is the initial content of the message. Allow FileMessages to be created without any arguments, so that they are compatible with emal.Parser. Add in assert statements to ensure that the required information is still entered. Implement FileMessage.setPayload(). The parent version is now deprecated, and this should also be avoided if possible (see the comment). Update Factory classes to allow initial content. Have testing setup use the Factory classes - this tests them and avoids using setPayload. The tests run, and sb_server still works, so I'm fairly confident that this hasn't broken anything. If it does, fix it or let me know and I will ASAP. Index: Corpus.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Corpus.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Corpus.py 6 Apr 2004 13:21:46 -0000 1.19 --- Corpus.py 14 Jul 2004 07:15:38 -0000 1.20 *************** *** 250,258 **** raise NotImplementedError ! def makeMessage(self, key): '''Call the factory to make a message''' # This method will likely be overridden ! msg = self.factory.create(key) return msg --- 250,258 ---- raise NotImplementedError ! def makeMessage(self, key, content=None): '''Call the factory to make a message''' # This method will likely be overridden ! msg = self.factory.create(key, content) return msg *************** *** 284,288 **** pass ! def create(self, key): '''Create a message instance''' raise NotImplementedError --- 284,288 ---- pass ! def create(self, key, content=None): '''Create a message instance''' raise NotImplementedError Index: FileCorpus.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/FileCorpus.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** FileCorpus.py 2 Apr 2004 18:10:52 -0000 1.11 --- FileCorpus.py 14 Jul 2004 07:15:38 -0000 1.12 *************** *** 85,88 **** --- 85,90 ---- from __future__ import generators + import email + from spambayes import Corpus from spambayes import message *************** *** 121,127 **** self.msgs[filename] = None ! def makeMessage(self, key): '''Ask our factory to make a Message''' ! msg = self.factory.create(key, self.directory) return msg --- 123,129 ---- self.msgs[filename] = None ! def makeMessage(self, key, content=None): '''Ask our factory to make a Message''' ! msg = self.factory.create(key, self.directory, content) return msg *************** *** 186,190 **** '''Message that persists as a file system artifact.''' ! def __init__(self,file_name, directory): '''Constructor(message file name, corpus directory name)''' message.SBHeaderMessage.__init__(self) --- 188,192 ---- '''Message that persists as a file system artifact.''' ! def __init__(self, file_name=None, directory=None): '''Constructor(message file name, corpus directory name)''' message.SBHeaderMessage.__init__(self) *************** *** 199,202 **** --- 201,208 ---- def pathname(self): '''Derive the pathname of the message file''' + assert(self.file_name is not None, + "Must set filename before using FileMessage instances.") + assert(self.directory is not None, + "Must set directory before using FileMessage instances.") return os.path.join(self.directory, self.file_name) *************** *** 214,217 **** --- 220,226 ---- return + assert(self.file_name is not None, + "Must set filename before using FileMessage instances.") + if options["globals", "verbose"]: print 'loading', self.file_name *************** *** 237,240 **** --- 246,252 ---- '''Write the Message substance to the file''' + assert(self.file_name is not None, + "Must set filename before using FileMessage instances.") + if options["globals", "verbose"]: print 'storing', self.file_name *************** *** 245,250 **** def setPayload(self, payload): self.loaded = True ! message.SBHeaderMessage.setPayload(self, payload) def remove(self): --- 257,282 ---- def setPayload(self, payload): + # This is a less-than-ideal method. The Python email package + # has a clear distinction between parsing an email message and + # creating an email message object. Here, we don't share that + # distinction, because our message object is trying to do its + # own parsing. A better system would be to have the factory + # that creates these messages do the load from file bit (this + # does mean we lose the current load-on-demand feature, but + # I'm not sure that's ever used). Alternatively, we could have + # a third type of FileMessage - PickledFileMessage - that stored + # the parsed form of the message. This might also remove the + # need for some of the message database (although that would then + # expire along with the messages...). This is something to + # consider before 1.1, however. self.loaded = True ! ! # We parse the content into a generic email.Message object. ! msg = email.message_from_string(payload, strict=False) ! ! # And then we set ourselves to be equal to it. ! self.set_payload(msg.get_payload()) ! self.set_unixfrom(msg.get_unixfrom()) ! self.set_charset(msg.get_charset()) def remove(self): *************** *** 262,274 **** def name(self): '''A unique name for the message''' return self.file_name def key(self): '''The key of this message in the msgs dictionary''' return self.file_name def __repr__(self): '''Instance as a representative string''' - sub = self.as_string() --- 294,309 ---- def name(self): '''A unique name for the message''' + assert(self.file_name is not None, + "Must set filename before using FileMessage instances.") return self.file_name def key(self): '''The key of this message in the msgs dictionary''' + assert(self.file_name is not None, + "Must set filename before using FileMessage instances.") return self.file_name def __repr__(self): '''Instance as a representative string''' sub = self.as_string() *************** *** 280,288 **** sub = sub[:20] - pn = os.path.join(self.directory, self.file_name) - return "<%s object at %8.8x, file: %s, %s>" % \ (self.__class__.__name__, \ ! id(self), pn, sub) def __str__(self): --- 315,321 ---- sub = sub[:20] return "<%s object at %8.8x, file: %s, %s>" % \ (self.__class__.__name__, \ ! id(self), self.pathname(), sub) def __str__(self): *************** *** 308,314 **** '''MessageFactory for FileMessage objects''' ! def create(self, key, directory): '''Create a message object from a filename in a directory''' ! return FileMessage(key, directory) --- 341,352 ---- '''MessageFactory for FileMessage objects''' ! def create(self, key, directory, content=None): '''Create a message object from a filename in a directory''' ! if content: ! msg = email.message_from_string(content, _class=FileMessage, ! strict=False) ! msg.file_name = key ! msg.directory = directory ! return msg return FileMessage(key, directory) *************** *** 318,321 **** --- 356,361 ---- def store(self): '''Write the Message substance to the file''' + assert(self.file_name is not None, + "Must set filename before using FileMessage instances.") if options["globals", "verbose"]: *************** *** 332,342 **** '''MessageFactory for FileMessage objects''' ! def create(self, key, directory): '''Create a message object from a filename in a directory''' ! return GzipFileMessage(key, directory) - def runTest(useGzip): --- 372,387 ---- '''MessageFactory for FileMessage objects''' ! def create(self, key, directory, content=None): '''Create a message object from a filename in a directory''' ! if content: ! msg = email.message_from_string(content, ! _class=GzipFileMessage, ! strict=False) ! msg.file_name = key ! msg.directory = directory ! return msg return GzipFileMessage(key, directory) def runTest(useGzip): *************** *** 379,388 **** print '\n\nA couple of message related tests' if useGzip: ! fmClass = GzipFileMessage else: ! fmClass = FileMessage ! m1 = fmClass('XMG00001', 'fctestspamcorpus') ! m1.setPayload(testmsg2()) print '\n\nAdd a message to hamcorpus that does not match the filter' --- 424,432 ---- print '\n\nA couple of message related tests' if useGzip: ! fmFactory = GzipFileMessageFactory() else: ! fmFactory = FileMessageFactory() ! m1 = fmFactory.create('XMG00001', 'fctestspamcorpus', testmsg2()) print '\n\nAdd a message to hamcorpus that does not match the filter' *************** *** 531,548 **** if useGzip: ! fmClass = GzipFileMessage else: ! fmClass = FileMessage ! m1 = fmClass('MSG00001', 'fctestspamcorpus') ! m1.setPayload(tm1) m1.store() ! m2 = fmClass('MSG00002', 'fctestspamcorpus') ! m2.setPayload(tm2) m2.store() ! m3 = fmClass('MSG00003', 'fctestunsurecorpus') ! m3.setPayload(tm1) m3.store() --- 575,589 ---- if useGzip: ! fmFactory = GzipFileMessageFactory() else: ! fmFactory = FileMessageFactory() ! m1 = fmFactory.create('MSG00001', 'fctestspamcorpus', tm1) m1.store() ! m2 = fmFactory.create('MSG00002', 'fctestspamcorpus', tm2) m2.store() ! m3 = fmFactory.create('MSG00003', 'fctestunsurecorpus', tm1) m3.store() *************** *** 555,568 **** print 'wait',10-x,'more second%s' % (s) ! m4 = fmClass('MSG00004', 'fctestunsurecorpus') ! m4.setPayload(tm1) m4.store() ! m5 = fmClass('MSG00005', 'fctestunsurecorpus') ! m5.setPayload(tm2) m5.store() ! m6 = fmClass('MSG00006', 'fctestunsurecorpus') ! m6.setPayload(tm2) m6.store() --- 596,606 ---- print 'wait',10-x,'more second%s' % (s) ! m4 = fmFactory.create('MSG00004', 'fctestunsurecorpus', tm1) m4.store() ! m5 = fmFactory.create('MSG00005', 'fctestunsurecorpus', tm2) m5.store() ! m6 = fmFactory.create('MSG00006', 'fctestunsurecorpus', tm2) m6.store() From anadelonbrin at users.sourceforge.net Wed Jul 14 09:17:02 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Jul 14 09:17:04 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_pop3dnd.py,1.9,1.10 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32171/scripts Modified Files: sb_pop3dnd.py Log Message: Allow IMAPMessages to be created without any arguments, so that they are compatible with emal.Parser. Add in assert statements to ensure that the required information is still entered. Avoid using setPayload. Index: sb_pop3dnd.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_pop3dnd.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** sb_pop3dnd.py 19 Jan 2004 17:58:20 -0000 1.9 --- sb_pop3dnd.py 14 Jul 2004 07:16:59 -0000 1.10 *************** *** 153,157 **** __implements__ = (IMessage,) ! def __init__(self, date): message.Message.__init__(self) # We want to persist more information than the generic --- 153,157 ---- __implements__ = (IMessage,) ! def __init__(self, date=None): message.Message.__init__(self) # We want to persist more information than the generic *************** *** 192,195 **** --- 192,197 ---- def getInternalDate(self): """Retrieve the date internally associated with this message.""" + assert(self.date is not None, + "Must set date to use IMAPMessage instance.") return self.date *************** *** 338,342 **** self.load() def load(self): ! self.setPayload(self.func(body=True, headers=True)) --- 340,344 ---- self.load() def load(self): ! self.set_payload(self.func(body=True, headers=True)) *************** *** 468,474 **** def addMessage(self, content, flags=(), date=None): """Add the given message to this mailbox.""" ! msg = self.storage.makeMessage(self.getUIDNext(True)) msg.date = date - msg.setPayload(content.read()) self.storage.addMessage(msg) self.store(MessageSet(long(msg.id), long(msg.id)), flags, 1, True) --- 470,476 ---- def addMessage(self, content, flags=(), date=None): """Add the given message to this mailbox.""" ! msg = self.storage.makeMessage(self.getUIDNext(True), ! content.read()) msg.date = date self.storage.addMessage(msg) self.store(MessageSet(long(msg.id), long(msg.id)), flags, 1, True) *************** *** 606,611 **** 'See .\r\n' date = imaplib.Time2Internaldate(time.time())[1:-1] ! msg = IMAPMessage(date) ! msg.setPayload(about) self.addMessage(msg) msg = DynamicIMAPMessage(self.buildStatusMessage) --- 608,614 ---- 'See .\r\n' date = imaplib.Time2Internaldate(time.time())[1:-1] ! msg = email.message_from_string(about, _class=IMAPMessage, ! strict=False) ! msg.date = date self.addMessage(msg) msg = DynamicIMAPMessage(self.buildStatusMessage) *************** *** 823,828 **** try: ! msg = message.SBHeaderMessage() ! msg.setPayload(messageText) # Now find the spam disposition and add the header. (prob, clues) = state.bayes.spamprob(msg.asTokens(),\ --- 826,830 ---- try: ! msg = message.sbheadermessage_from_string(messageText) # Now find the spam disposition and add the header. (prob, clues) = state.bayes.spamprob(msg.asTokens(),\ From anadelonbrin at users.sourceforge.net Wed Jul 14 09:18:55 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Jul 14 09:18:58 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_server.py,1.22,1.23 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32730/scripts Modified Files: sb_server.py Log Message: Avoid using setPayload, which doesn't work with Python 2.4a1. (When [ 990700 ] Changes to asyncore in Python 2.4 break ServerLineReader and [ 990685 ] Change in cgi.parse_qs breaks sb_server in Python 2.4 are checked in sb_server appears to work with Python 2.4a1 from my admittedly limited testing). Index: sb_server.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_server.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** sb_server.py 9 Jul 2004 09:26:21 -0000 1.22 --- sb_server.py 14 Jul 2004 07:18:53 -0000 1.23 *************** *** 468,473 **** try: ! msg = spambayes.message.SBHeaderMessage() ! msg.setPayload(messageText) msg.setId(state.getNewMessageName()) # Now find the spam disposition and add the header. --- 468,472 ---- try: ! msg = spambayes.message.sbheadermessage_from_string(messageText) msg.setId(state.getNewMessageName()) # Now find the spam disposition and add the header. *************** *** 509,514 **** not isSuppressedBulkHam and not isTooBig): # Write the message into the Unknown cache. ! message = state.unknownCorpus.makeMessage(msg.getId()) ! message.setPayload(msg.as_string()) state.unknownCorpus.addMessage(message) --- 508,513 ---- not isSuppressedBulkHam and not isTooBig): # Write the message into the Unknown cache. ! makeMessage = state.unknownCorpus.makeMessage ! message = makeMessage(msg.getId(), msg.as_string()) state.unknownCorpus.addMessage(message) From anadelonbrin at users.sourceforge.net Wed Jul 14 09:23:55 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Jul 14 09:23:58 2004 Subject: [Spambayes-checkins] spambayes/spambayes ProxyUI.py,1.45,1.46 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1261/spambayes Modified Files: ProxyUI.py Log Message: Avoid using setPayload, which doesn't work with Python 2.4a1 Index: ProxyUI.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** ProxyUI.py 16 Mar 2004 05:08:31 -0000 1.45 --- ProxyUI.py 14 Jul 2004 07:23:53 -0000 1.46 *************** *** 195,200 **** for m in messages: messageName = state.getNewMessageName() ! message = state.unknownCorpus.makeMessage(messageName) ! message.setPayload(m) state.unknownCorpus.addMessage(message) --- 195,199 ---- for m in messages: messageName = state.getNewMessageName() ! message = state.unknownCorpus.makeMessage(messageName, m) state.unknownCorpus.addMessage(message) From anadelonbrin at users.sourceforge.net Wed Jul 14 09:24:47 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Jul 14 09:24:49 2004 Subject: [Spambayes-checkins] spambayes README-DEVEL.txt,1.12,1.13 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1468 Modified Files: README-DEVEL.txt Log Message: Update the release instructions. Index: README-DEVEL.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/README-DEVEL.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** README-DEVEL.txt 8 Feb 2004 02:45:37 -0000 1.12 --- README-DEVEL.txt 14 Jul 2004 07:24:45 -0000 1.13 *************** *** 505,511 **** o Now commit spambayes/__init__.py and tag the whole checkout - see the existing tag names for the tag name format. ! o Update the website News, Download and Application sections. o Update reply.txt in the website repository as needed (it specifies the ! latest version). Then let Tim, Barry or Skip know that they need to update the autoresponder. --- 505,511 ---- o Now commit spambayes/__init__.py and tag the whole checkout - see the existing tag names for the tag name format. ! o Update the website News, Download, Windows and Application sections. o Update reply.txt in the website repository as needed (it specifies the ! latest version). Then let Tim, Barry, Tony, or Skip know that they need to update the autoresponder. From anadelonbrin at users.sourceforge.net Wed Jul 14 10:59:29 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Jul 14 10:59:33 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_imapfilter.py,1.32,1.33 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17618/scripts Modified Files: sb_imapfilter.py Log Message: Fix [ 959937 ] "Invalid server" message not always correct Index: sb_imapfilter.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_imapfilter.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** sb_imapfilter.py 24 May 2004 06:23:26 -0000 1.32 --- sb_imapfilter.py 14 Jul 2004 08:59:27 -0000 1.33 *************** *** 203,207 **** try: BaseIMAP.__init__(self, server, port) ! except: # A more specific except would be good here, but I get # (in Python 2.2) a generic 'error' and a 'gaierror' --- 203,207 ---- try: BaseIMAP.__init__(self, server, port) ! except (BaseIMAP.error, socket.gaierror, socket.error): # A more specific except would be good here, but I get # (in Python 2.2) a generic 'error' and a 'gaierror' *************** *** 209,213 **** # or invalid domain (respectively) print "Invalid server or port, please check these settings." ! sys.exit(-1) self.debug = debug # For efficiency, we remember which folder we are currently --- 209,213 ---- # or invalid domain (respectively) print "Invalid server or port, please check these settings." ! sys.exit() self.debug = debug # For efficiency, we remember which folder we are currently *************** *** 223,227 **** BaseIMAP.login(self, username, pwd) # superclass login except BaseIMAP.error, e: ! if str(e) == "permission denied": print "There was an error logging in to the IMAP server." print "The userid and/or password may be incorrect." --- 223,227 ---- BaseIMAP.login(self, username, pwd) # superclass login except BaseIMAP.error, e: ! if str(e) == "permission denied" or str(e) == "Login failed.": print "There was an error logging in to the IMAP server." print "The userid and/or password may be incorrect." From anadelonbrin at users.sourceforge.net Wed Jul 14 11:20:16 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Jul 14 11:20:19 2004 Subject: [Spambayes-checkins] spambayes/spambayes Options.py,1.107,1.108 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21689/spambayes Modified Files: Options.py Log Message: Fix [ 944109 ] notate_to/subject option valid values should be dynamic Index: Options.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Options.py,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** Options.py 12 Apr 2004 01:59:26 -0000 1.107 --- Options.py 14 Jul 2004 09:20:13 -0000 1.108 *************** *** 1229,1232 **** --- 1229,1247 ---- options.merge_file(optionsPathname) + # Annoyingly, we have a special case. The notate_to and notate_subject + # allowed values have to be set to the same values as the header_x_ + # options, but this can't be done (AFAIK) dynmaically. If this isn't + # the case, then if the header_x_string values are changed, the + # notate_ options don't work. Outlook Express users like both of + # these options...so we fix it here. See also sf #944109. + header_strings = (options["Headers", "header_ham_string"], + options["Headers", "header_spam_string"], + options["Headers", "header_unsure_string"]) + notate_to = options.get_option("Headers", "notate_to") + notate_subject = options.get_option("Headers", "notate_subject") + notate_to.allowed_values = header_strings + notate_subject.allowed_values = header_strings + + def get_pathname_option(section, option): """Return the option relative to the path specified in the From anadelonbrin at users.sourceforge.net Wed Jul 14 12:05:51 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Jul 14 12:05:53 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_mailsort.py,1.1,1.2 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28718/scripts Modified Files: sb_mailsort.py Log Message: Fix [ 790757 ] signal handler created with wrong # of args Note that I don't use sb_mailsort.py (does anyone?), but the documentation for the signal module says that the second parameter should be a function that takes two arguments, which it wasn't, so either the documenation or the script is wrong, and it seems unlikely that it's the documentation. Index: sb_mailsort.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_mailsort.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** sb_mailsort.py 5 Sep 2003 01:16:45 -0000 1.1 --- sb_mailsort.py 14 Jul 2004 10:05:48 -0000 1.2 *************** *** 100,104 **** def filter_message(hamdir, spamdir): ! signal.signal(signal.SIGALRM, lambda s: sys.exit(1)) signal.alarm(24 * 60 * 60) --- 100,104 ---- def filter_message(hamdir, spamdir): ! signal.signal(signal.SIGALRM, lambda s, f: sys.exit(1)) signal.alarm(24 * 60 * 60) From montanaro at users.sourceforge.net Wed Jul 14 15:10:22 2004 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Wed Jul 14 15:10:24 2004 Subject: [Spambayes-checkins] website faq.txt,1.76,1.77 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26203 Modified Files: faq.txt Log Message: add q&a about AOL Mail Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** faq.txt 25 Jun 2004 05:12:10 -0000 1.76 --- faq.txt 14 Jul 2004 13:10:19 -0000 1.77 *************** *** 380,383 **** --- 380,394 ---- + Can I use SpamBayes with AOL Mail? + ---------------------------------- + + You can't use SpamBayes directly with the normal AOL Mail interface, but + AOL's Mail system is reputed to allow IMAP access. If that proves to be + correct you should be able to use the SpamBayes IMAP filter + (sb_imapfilter.py) to scrub your AOL mailbox. Should you try this, reports + of your successes or failures on the spambayes@python.org mailing list would + be appreciated. + + How do I configure Eudora for use with SpamBayes? ------------------------------------------------- From kpitt at users.sourceforge.net Thu Jul 15 21:47:47 2004 From: kpitt at users.sourceforge.net (Kenny Pitt) Date: Thu Jul 15 21:47:50 2004 Subject: [Spambayes-checkins] website style.css,1.10,1.11 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10385 Modified Files: style.css Log Message: Tweak stylesheet to correct margins and eliminate unnecessary horizontal scrolling in Internet Explorer. Index: style.css =================================================================== RCS file: /cvsroot/spambayes/website/style.css,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** style.css 13 Aug 2003 14:32:26 -0000 1.10 --- style.css 15 Jul 2004 19:47:45 -0000 1.11 *************** *** 4,8 **** BODY { background: white; color: #484848; ! margin-right: 15%; font-family: geneva, verdana, arial, "ms sans serif", sans-serif; font-size: 12pt; --- 4,8 ---- BODY { background: white; color: #484848; ! margin: 0 0; font-family: geneva, verdana, arial, "ms sans serif", sans-serif; font-size: 12pt; *************** *** 39,42 **** --- 39,44 ---- font-weight: bold;} + TD.body { padding-right: 15; } + /* used in the windows/outlook compatibility matrix */ TD.unknown { From anadelonbrin at users.sourceforge.net Fri Jul 16 01:53:29 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 16 01:53:33 2004 Subject: [Spambayes-checkins] spambayes/spambayes FileCorpus.py,1.12,1.13 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24075/spambayes Modified Files: FileCorpus.py Log Message: Fix a bug I introduced with the last check-in. email.Message.set_payload and get_payload only handle the body of the message, so we also need to copy across the headers. Index: FileCorpus.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/FileCorpus.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** FileCorpus.py 14 Jul 2004 07:15:38 -0000 1.12 --- FileCorpus.py 15 Jul 2004 23:53:27 -0000 1.13 *************** *** 279,282 **** --- 279,285 ---- self.set_unixfrom(msg.get_unixfrom()) self.set_charset(msg.get_charset()) + for name, value in msg.items(): + del self[name] + self[name] = value def remove(self): From anadelonbrin at users.sourceforge.net Fri Jul 16 02:31:38 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 16 02:31:40 2004 Subject: [Spambayes-checkins] spambayes/spambayes FileCorpus.py,1.13,1.14 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30741/spambayes Modified Files: FileCorpus.py Log Message: Fix another bug I introduced. If we don't set msg.loaded, then the body is wiped (we try to load it from the file, which we haven't written yet). Index: FileCorpus.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/FileCorpus.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** FileCorpus.py 15 Jul 2004 23:53:27 -0000 1.13 --- FileCorpus.py 16 Jul 2004 00:31:34 -0000 1.14 *************** *** 282,285 **** --- 282,287 ---- del self[name] self[name] = value + print msg.get_payload() + print msg.as_string() def remove(self): *************** *** 351,354 **** --- 353,357 ---- msg.file_name = key msg.directory = directory + msg.loaded = True return msg return FileMessage(key, directory) *************** *** 383,386 **** --- 386,390 ---- msg.file_name = key msg.directory = directory + msg.loaded = True return msg return GzipFileMessage(key, directory) From anadelonbrin at users.sourceforge.net Fri Jul 16 03:00:06 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 16 03:00:09 2004 Subject: [Spambayes-checkins] spambayes/spambayes FileCorpus.py,1.14,1.15 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2546/spambayes Modified Files: FileCorpus.py Log Message: Remove debugging prints. Index: FileCorpus.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/FileCorpus.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** FileCorpus.py 16 Jul 2004 00:31:34 -0000 1.14 --- FileCorpus.py 16 Jul 2004 01:00:04 -0000 1.15 *************** *** 282,287 **** del self[name] self[name] = value - print msg.get_payload() - print msg.as_string() def remove(self): --- 282,285 ---- From anadelonbrin at users.sourceforge.net Fri Jul 16 03:02:41 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 16 03:02:44 2004 Subject: [Spambayes-checkins] spambayes/spambayes ProxyUI.py,1.46,1.47 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3001/spambayes Modified Files: ProxyUI.py Log Message: Fix [ 943852 ] Incorrect sort order for Score column Also fix a related bug - the sort order for the ham messages would always be the *reverse* of the spam/unsure messages. Index: ProxyUI.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** ProxyUI.py 14 Jul 2004 07:23:53 -0000 1.46 --- ProxyUI.py 16 Jul 2004 01:02:26 -0000 1.47 *************** *** 259,263 **** return keys, date, prior, start, end ! def _sortMessages(self, messages, sort_order): """Sorts the message by the appropriate attribute. If this was the previous sort order, then reverse it.""" --- 259,263 ---- return keys, date, prior, start, end ! def _sortMessages(self, messages, sort_order, reverse=False): """Sorts the message by the appropriate attribute. If this was the previous sort order, then reverse it.""" *************** *** 272,290 **** self.previous_sort = 'received' return messages ! else: ! tmplist = [(getattr(x[1], sort_order), x) for x in messages] tmplist.sort() ! if self.previous_sort == sort_order: tmplist.reverse() - self.previous_sort = None - else: - self.previous_sort = sort_order return [x for (key, x) in tmplist] ! def _appendMessages(self, table, keyedMessageInfo, label, sort_order): """Appends the rows of a table of messages to 'table'.""" stripe = 0 ! keyedMessageInfo = self._sortMessages(keyedMessageInfo, sort_order) nrows = options["html_ui", "rows_per_section"] for key, messageInfo in keyedMessageInfo[:nrows]: --- 272,288 ---- self.previous_sort = 'received' return messages ! tmplist = [(getattr(x[1], sort_order), x) for x in messages] tmplist.sort() ! if reverse: tmplist.reverse() return [x for (key, x) in tmplist] ! def _appendMessages(self, table, keyedMessageInfo, label, sort_order, ! reverse=False): """Appends the rows of a table of messages to 'table'.""" stripe = 0 ! keyedMessageInfo = self._sortMessages(keyedMessageInfo, sort_order, ! reverse) nrows = options["html_ui", "rows_per_section"] for key, messageInfo in keyedMessageInfo[:nrows]: *************** *** 293,297 **** row = self.html.reviewRow.clone() try: ! score = float(messageInfo.score.rstrip('%')) except ValueError: score = None --- 291,295 ---- row = self.html.reviewRow.clone() try: ! score = messageInfo.score except ValueError: score = None *************** *** 334,338 **** # the message score, and the time the message was received. if options["html_ui", "display_score"]: ! row.score_ = messageInfo.score else: del row.score_ --- 332,340 ---- # the message score, and the time the message was received. if options["html_ui", "display_score"]: ! if isinstance(messageInfo.score, types.StringTypes): ! # Presumably either "?" or "Err". ! row.score_ = messageInfo.score ! else: ! row.score_ = "%.2f%%" % (messageInfo.score,) else: del row.score_ *************** *** 556,559 **** --- 558,572 ---- templateRow = page.reviewRow.clone() + # The decision about whether to reverse the sort + # order has to go here, because _sortMessages gets called + # thrice, and so the ham list would end up sorted backwards. + sort_order = params.get('sort') + if self.previous_sort == sort_order: + reverse = True + self.previous_sort = None + else: + reverse = False + self.previous_sort = sort_order + page.table = "" # To make way for the real rows. for header, label in ((options["Headers", *************** *** 583,587 **** page.table += subHeader self._appendMessages(page.table, messages, label, ! params.get('sort')) page.table += self.html.trainRow --- 596,600 ---- page.table += subHeader self._appendMessages(page.table, messages, label, ! sort_order, reverse) page.table += self.html.trainRow *************** *** 666,670 **** score = score[:op] try: ! score = "%.2f%%" % (float(score)*100,) except ValueError: # Hmm. The score header should only contain a floating --- 679,683 ---- score = score[:op] try: ! score = float(score) * 100 except ValueError: # Hmm. The score header should only contain a floating From anadelonbrin at users.sourceforge.net Fri Jul 16 04:00:41 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 16 04:00:44 2004 Subject: [Spambayes-checkins] spambayes/spambayes Options.py,1.108,1.109 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12656/spambayes Modified Files: Options.py Log Message: Correct two help strings. Index: Options.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Options.py,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** Options.py 14 Jul 2004 09:20:13 -0000 1.108 --- Options.py 16 Jul 2004 02:00:35 -0000 1.109 *************** *** 560,565 **** better at classifying your email. This option specifies the name of the database file. If you don't give a full pathname, ! the name will be taken to be relative to the current working ! directory.""", FILE_WITH_PATH, DO_NOT_RESTORE), --- 560,565 ---- better at classifying your email. This option specifies the name of the database file. If you don't give a full pathname, ! the name will be taken to be relative to the location of the ! most recent configuration file loaded.""", FILE_WITH_PATH, DO_NOT_RESTORE), *************** *** 570,575 **** or reclassified (unless specifically requested to). This option specifies the name of the database file. If you don't give a ! full pathname, the name will be taken to be relative to the current ! working directory.""", FILE_WITH_PATH, DO_NOT_RESTORE), --- 570,575 ---- or reclassified (unless specifically requested to). This option specifies the name of the database file. If you don't give a ! full pathname, the name will be taken to be relative to the location ! of the most recent configuration file loaded.""", FILE_WITH_PATH, DO_NOT_RESTORE), From anadelonbrin at users.sourceforge.net Fri Jul 16 04:02:35 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 16 04:02:37 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_server.py,1.23,1.24 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12887/scripts Modified Files: sb_server.py Log Message: Implemented [ 887984 ] Remove "Save and Shutdown" button when running as service Index: sb_server.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_server.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** sb_server.py 14 Jul 2004 07:18:53 -0000 1.23 --- sb_server.py 16 Jul 2004 02:02:32 -0000 1.24 *************** *** 699,707 **** self.platform_mutex = None ! def prepare(self): # If we can, prevent multiple servers from running at the same time. assert self.platform_mutex is None, "Should not already have the mutex" self.platform_mutex = open_platform_mutex() # Do whatever we've been asked to do... self.createWorkers() --- 699,713 ---- self.platform_mutex = None ! def prepare(self, can_stop=True): ! """Do whatever needs to be done to prepare for running. If ! can_stop is False, then we may not let the user shut down the ! proxy - for example, running as a Windows service this should ! be the case.""" # If we can, prevent multiple servers from running at the same time. assert self.platform_mutex is None, "Should not already have the mutex" self.platform_mutex = open_platform_mutex() + self.can_stop = can_stop + # Do whatever we've been asked to do... self.createWorkers() *************** *** 871,877 **** Dibbler.run(launchBrowser=launchUI) ! def prepare(): state.init() ! state.prepare() # Launch any SMTP proxies. Note that if the user hasn't specified any # SMTP proxy information in their configuration, then nothing will --- 877,883 ---- Dibbler.run(launchBrowser=launchUI) ! def prepare(can_stop=True): state.init() ! state.prepare(can_stop) # Launch any SMTP proxies. Note that if the user hasn't specified any # SMTP proxy information in their configuration, then nothing will From anadelonbrin at users.sourceforge.net Fri Jul 16 04:02:35 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 16 04:02:38 2004 Subject: [Spambayes-checkins] spambayes/spambayes ProxyUI.py,1.47,1.48 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12887/spambayes Modified Files: ProxyUI.py Log Message: Implemented [ 887984 ] Remove "Save and Shutdown" button when running as service Index: ProxyUI.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** ProxyUI.py 16 Jul 2004 01:02:26 -0000 1.47 --- ProxyUI.py 16 Jul 2004 02:02:32 -0000 1.48 *************** *** 159,162 **** --- 159,166 ---- self.app_for_version = "POP3 Proxy" self.previous_sort = None + if not proxy_state.can_stop: + self.html._readonly = False + self.html.shutdownTableCell = " " + self.html._readonly = True def onHome(self): From anadelonbrin at users.sourceforge.net Fri Jul 16 04:02:35 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 16 04:02:38 2004 Subject: [Spambayes-checkins] spambayes/windows pop3proxy_service.py, 1.17, 1.18 Message-ID: Update of /cvsroot/spambayes/spambayes/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12887/windows Modified Files: pop3proxy_service.py Log Message: Implemented [ 887984 ] Remove "Save and Shutdown" button when running as service Index: pop3proxy_service.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/windows/pop3proxy_service.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** pop3proxy_service.py 16 Dec 2003 05:06:34 -0000 1.17 --- pop3proxy_service.py 16 Jul 2004 02:02:33 -0000 1.18 *************** *** 108,112 **** # Setup our state etc try: ! sb_server.prepare() except sb_server.AlreadyRunningException: msg = "The SpamBayes proxy service could not be started, as "\ --- 108,112 ---- # Setup our state etc try: ! sb_server.prepare(can_stop=False) except sb_server.AlreadyRunningException: msg = "The SpamBayes proxy service could not be started, as "\ From kpitt at users.sourceforge.net Fri Jul 16 16:09:40 2004 From: kpitt at users.sourceforge.net (Kenny Pitt) Date: Fri Jul 16 16:09:43 2004 Subject: [Spambayes-checkins] spambayes/windows/py2exe setup_all.py, 1.18, 1.19 Message-ID: Update of /cvsroot/spambayes/spambayes/windows/py2exe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18399 Modified Files: setup_all.py Log Message: Fix [941639] and [986353]: Some utilities such as ZipMagic detect files with a .ZIP extension and turn them into folders, which throws off Python's zip import functionality. Since py2exe doesn't care what filename is used for the zip archive, use a non-standard extension so that the archive will be ignored by ZIP utilities. Index: setup_all.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/windows/py2exe/setup_all.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** setup_all.py 10 Jun 2004 04:36:51 -0000 1.18 --- setup_all.py 16 Jul 2004 14:09:37 -0000 1.19 *************** *** 158,161 **** data_files = outlook_data_files + proxy_data_files + common_data_files, options = {"py2exe" : py2exe_options}, ! zipfile = "lib/spambayes.zip", ) --- 158,161 ---- data_files = outlook_data_files + proxy_data_files + common_data_files, options = {"py2exe" : py2exe_options}, ! zipfile = "lib/spambayes.modules", ) From kpitt at users.sourceforge.net Fri Jul 16 17:23:13 2004 From: kpitt at users.sourceforge.net (Kenny Pitt) Date: Fri Jul 16 17:23:17 2004 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py, 1.129, 1.130 msgstore.py, 1.86, 1.87 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1050 Modified Files: addin.py msgstore.py Log Message: Add an "Empty Spam Folder" option to the SpamBayes dropdown menu. This implements RFE [ 788755 ] by applying patch [ 831941 ]. Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.129 retrieving revision 1.130 diff -C2 -d -r1.129 -r1.130 *** addin.py 4 Jul 2004 06:19:40 -0000 1.129 --- addin.py 16 Jul 2004 15:23:10 -0000 1.130 *************** *** 526,529 **** --- 526,556 ---- new_msg.Display() + # Event function fired from the "Empty Spam Folder" UI item. + def EmptySpamFolder(mgr): + config = mgr.config.filter + ms = mgr.message_store + spam_folder_id = getattr(config, "spam_folder_id") + try: + spam_folder = ms.GetFolder(spam_folder_id) + except ms.MsgStoreException: + mgr.LogDebug(0, "ERROR: Unable to open the spam folder for emptying - " \ + "spam messages were not deleted") + else: + try: + if spam_folder.GetItemCount() > 0: + message = "Are you sure you want to permanently delete all items " \ + "in the \"%s\" folder?" % spam_folder.name + if mgr.AskQuestion(message): + mgr.LogDebug(2, "Emptying spam from folder '%s'" % spam_folder.GetFQName()) + import manager + spam_folder.EmptyFolder(manager._GetParent()) + else: + mgr.LogDebug(2, "Spam folder '%s' was already empty" % spam_folder.GetFQName()) + message = "The \"%s\" folder is already empty." % spam_folder.name + mgr.ReportInformation(message) + except: + mgr.LogDebug(0, "Error emptying spam folder '%s'!" % spam_folder.GetFQName()) + traceback.print_exc() + def CheckLatestVersion(manager): from spambayes.Version import get_version_string, get_version_number, fetch_latest_dict *************** *** 860,867 **** --- 887,903 ---- self._AddControl(popup, constants.msoControlButton, + ButtonEvent, (EmptySpamFolder, self.manager), + Caption="Empty Spam Folder", + Enabled=True, + Visible=True, + BeginGroup=True, + Tag = "SpamBayesCommand.EmptySpam") + self._AddControl(popup, + constants.msoControlButton, ButtonEvent, (CheckLatestVersion, self.manager,), Caption="Check for new version", Enabled=True, Visible=True, + BeginGroup=True, Tag = "SpamBayesCommand.CheckVersion") helpPopup = self._AddControl( *************** *** 904,907 **** --- 940,944 ---- Enabled=True, Visible=True, + BeginGroup=True, Tag = "SpamBayesCommand.TestSuite") self.have_setup_ui = True Index: msgstore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** msgstore.py 3 May 2004 23:21:00 -0000 1.86 --- msgstore.py 16 Jul 2004 15:23:10 -0000 1.87 *************** *** 35,38 **** --- 35,40 ---- SUPPRESS_RECEIPT = 0x1 + FOLDER_DIALOG = 0x00000002 + USE_DEFERRED_ERRORS = mapi.MAPI_DEFERRED_ERRORS # or set to zero to see what changes *************** *** 646,649 **** --- 648,671 ---- return self._FolderFromMAPIFolder(ret) + def GetItemCount(self): + try: + folder = self.OpenEntry() + return folder.GetContentsTable(0).GetRowCount(0) + except pythoncom.com_error, details: + raise MsgStoreExceptionFromCOMException(details) + + # EmptyFolder() *permanently* deletes ALL messages and subfolders from + # this folder without deleting the folder itself. + # + # WORD OF WARNING: This is a *very dangerous* function that has the + # potential to destroy a user's mail. Don't even *think* about calling + # this function on anything but the Certain Spam folder! + def EmptyFolder(self, parentWindow): + try: + folder = self.OpenEntry() + folder.EmptyFolder(parentWindow, None, FOLDER_DIALOG) + except pythoncom.com_error, details: + raise MsgStoreExceptionFromCOMException(details) + def DoesFolderHaveOutlookField(self, field_name): # Returns True if the specified folder has an *Outlook* field with From anadelonbrin at users.sourceforge.net Mon Jul 19 04:10:14 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Jul 19 04:10:18 2004 Subject: [Spambayes-checkins] spambayes/spambayes Dibbler.py,1.13,1.14 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6773/spambayes Modified Files: Dibbler.py Log Message: Apply Richie's test for [ 990700 ] Changes to asyncore in Python 2.4 break ServerLineReader which seems to work for me w/ Python 2.4a1 Index: Dibbler.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Dibbler.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Dibbler.py 12 Jan 2004 14:13:01 -0000 1.13 --- Dibbler.py 19 Jul 2004 02:10:12 -0000 1.14 *************** *** 189,193 **** """See `asynchat.async_chat`.""" asynchat.async_chat.__init__(self, conn) ! self._map = map self._closed = False --- 189,193 ---- """See `asynchat.async_chat`.""" asynchat.async_chat.__init__(self, conn) ! self.__map = map self._closed = False *************** *** 216,220 **** """Remove this object from the correct socket map.""" self._closed = True ! self.del_channel(self._map) self.socket.close() --- 216,220 ---- """Remove this object from the correct socket map.""" self._closed = True ! self.del_channel(self.__map) self.socket.close() From tameyer at ihug.co.nz Mon Jul 19 04:16:10 2004 From: tameyer at ihug.co.nz (Tony Meyer) Date: Mon Jul 19 04:16:19 2004 Subject: [Spambayes-checkins] spambayes/spambayes Dibbler.py,1.13,1.14 In-Reply-To: <1ED4ECF91CDED24C8D012BCF2B034F1307257BBE@its-xchg4.massey.ac.nz> Message-ID: <1ED4ECF91CDED24C8D012BCF2B034F1304678165@its-xchg4.massey.ac.nz> > Update of /cvsroot/spambayes/spambayes/spambayes > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6773/spambayes > > Modified Files: > Dibbler.py > Log Message: > Apply Richie's test for [ 990700 ] Changes to asyncore in > Python 2.4 break ServerLineReader > which seems to work for me w/ Python 2.4a1 And by "test", I mean "fix"... =Tony Meyer From anadelonbrin at users.sourceforge.net Mon Jul 19 05:21:28 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Jul 19 05:21:32 2004 Subject: [Spambayes-checkins] spambayes WHAT_IS_NEW.txt,1.35.4.1,1.35.4.2 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14818 Modified Files: Tag: release_1_0-branch WHAT_IS_NEW.txt Log Message: Update for 1.0. Index: WHAT_IS_NEW.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/WHAT_IS_NEW.txt,v retrieving revision 1.35.4.1 retrieving revision 1.35.4.2 diff -C2 -d -r1.35.4.1 -r1.35.4.2 *** WHAT_IS_NEW.txt 23 Jun 2004 23:15:28 -0000 1.35.4.1 --- WHAT_IS_NEW.txt 19 Jul 2004 03:21:23 -0000 1.35.4.2 *************** *** 11,68 **** changes" section. ! New in 1.0 Release Candiate 2 ! ============================= ! ! -------------------------- ! ** Incompatible changes ** ! -------------------------- ! ! There should be no incompatible changes (from 1.0rc1) in this release. ! ! ! ------------------- ! ** Other changes ** ! ------------------- ! ! Outlook Plugin ! -------------- ! o Selecting mailboxes on multiple Exchange accounts has been fixed. ! ! General ! ------- ! o Improved the db_expimp.py script when using Python 2.2. ! ! ! Transition ========== - If you are transitioning from a version older than 1.0rc1, please - read the notes in the previous release notes (accessible from - ). - - - Reported Bugs Fixed - =================== - The following bugs tracked via the Sourceforge system were fixed: - 961713, 955442, 943397 - - A URL containing the details of these bugs can be made by appending the - bug number to this URL: - http://sourceforge.net/tracker/index.php?func=detail&group_id=61702&atid=498103&aid= - - - Feature Requests Added - ====================== - No feature requests tracked via the Sourceforge system were added for this - release. - ! Patches integrated ! =================== ! No patches tracked via the Sourceforge system were integrated for this ! release. ! Newly Deprecated Options ! ======================== Since 1.0a9, SpamBayes has had a method of noting options that are --- 11,24 ---- changes" section. ! New in 1.0 ========== ! There have been no changes made between 1.0rc2 and 1.0. If you are ! upgrading from an earlier version, you may wish to read the WHAT_IS_NEW ! files from the versions that you skipped, as well. ! Deprecated Options ! ================== Since 1.0a9, SpamBayes has had a method of noting options that are *************** *** 93,98 **** ! New Experimental Options ! ======================== Since 1.0a9, SpamBayes has had a method of noting options that are --- 49,54 ---- ! Experimental Options ! ==================== Since 1.0a9, SpamBayes has had a method of noting options that are From anadelonbrin at users.sourceforge.net Mon Jul 19 05:21:47 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Jul 19 05:21:50 2004 Subject: [Spambayes-checkins] spambayes CHANGELOG.txt,1.44.4.1,1.44.4.2 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14866 Modified Files: Tag: release_1_0-branch CHANGELOG.txt Log Message: Update for 1.0. Index: CHANGELOG.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/CHANGELOG.txt,v retrieving revision 1.44.4.1 retrieving revision 1.44.4.2 diff -C2 -d -r1.44.4.1 -r1.44.4.2 *** CHANGELOG.txt 23 Jun 2004 23:10:00 -0000 1.44.4.1 --- CHANGELOG.txt 19 Jul 2004 03:21:45 -0000 1.44.4.2 *************** *** 1,4 **** --- 1,8 ---- [Note that all dates are in English, not American format - i.e. day/month/year] + 1.0 Final + ========= + (no changes from 1.0rc2) + Release Candidate 2 =================== From anadelonbrin at users.sourceforge.net Mon Jul 19 05:39:27 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Jul 19 05:39:30 2004 Subject: [Spambayes-checkins] spambayes CHANGELOG.txt,1.45,1.46 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16660 Modified Files: CHANGELOG.txt Log Message: Bring up to date. Index: CHANGELOG.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/CHANGELOG.txt,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** CHANGELOG.txt 23 Jun 2004 23:08:45 -0000 1.45 --- CHANGELOG.txt 19 Jul 2004 03:39:24 -0000 1.46 *************** *** 3,6 **** --- 3,26 ---- Future Release ============== + Tony Meyer 19/07/2004 Fix [ 990700 ] Changes to asyncore in Python 2.4 break ServerLineReader + Kenny Pitt 17/07/2004 Add an "Empty Spam Folder" option to the plug-in dropdown menu. (Patch [831941]) + Kenny Pitt 17/07/2004 Fix [941639] and [986353]. Use a non-standard extension for our py2exe created zip to get around Windows extensions that automatically expand zip files. + Tony Meyer 16/07/2004 Fix [ 943852 ] Incorrect sort order for Score column + Tony Meyer 16/07/2004 Implemented [ 887984 ] Remove "Save and Shutdown" button when running as service + Tony Meyer 14/07/2004 Fix [ 790757 ] signal handler created with wrong # of args + Tony Meyer 14/07/2004 Fix [ 944109 ] notate_to/subject option valid values should be dynamic + Tony Meyer 14/07/2004 Fix [ 959937 ] "Invalid server" message not always correct + Tony Meyer 14/07/2004 When slurping, use a lower timeout so things work faster (with Python >=2.3) + Tony Meyer 14/07/2004 setPayload() in message.py doesn't work in Python 2.4, so avoid. Refactor Corpus.py and FileCorpus.py to allow this. + Skip Montanaro 10/07/2004 tte.py: 2.3 compatibility: add reversed() function + Skip Montanaro 10/07/2004 tte.py: When deciding if messages are misses or not, consider whether they have Message-Id or Subject headers. + Tony Meyer 09/07/2004 Using -u with sb_server had been broken. Fix this. + Tony Meyer 09/07/2004 Update test_storage.py test to reflect (current) correct way to call open_storage. Fixes part of [ 981970 ] tests failing. + Tony Meyer 04/07/2004 Add a time stamp to the Outlook plug-in logs. + Tony Meyer 04/07/2004 Fix [ 933473 ] Unnecessary spam folder hook. + Neil Schemenauer 30/06/2004 New script, hammie2cdb.py, that converts hammie databases into cdb databases (usable by CdbClassifier). + Skip Montanaro 29/06/2004 tte.py: Worm around the extremely rare case during verbose most where the message sneaks through without either a message-id or a subject. + Skip Montanaro 26/06/2004 New script, postfixproxy.py, a first cut proxy filter for use with PostFix 2.1's content filter stuff. + Skip Montanaro 26/06/2004 hammie: Rename filter() to score_and_filter() and return both the spamprob and the modified message. Tony Meyer 11/06/2004 Add the "sb_culler.py" script from the SB wiki by Andrew Dalke. Tony Meyer 01/06/2004 Add fixes from [ 962693 ] mozilla/thunderbird/netscape profile dir detection *************** *** 10,13 **** --- 30,37 ---- Toby Dickenson 06/05/2004 Add a C implementation of sb_bnfilter. Tweak the Python version to minimise differences between the two. Enable psyco in sb_bnserver. + 1.0 Final + ========= + (no changes from 1.0rc2) + Release Candidate 2 =================== From anadelonbrin at users.sourceforge.net Mon Jul 19 08:52:39 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Jul 19 08:52:47 2004 Subject: [Spambayes-checkins] website faq.txt,1.77,1.78 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3279 Modified Files: faq.txt Log Message: In the questions about setting options there are some python commands in the form 'python -c "command; command"'. This is a nice form in that the user can just run them from a shell and not need to start up the interactive interpreter, but make for very long lines. Because they were so long, the whole FAQ would need horizontal scrolling on low resolutions. That seemed a high price to pay for the more correct way to display the options, so I've wrapped them, and put in notes explaining that the wrapping is only for display. I imagine these particular two FAQs are rarely used now anyway. If anyone feels that this is the wrong decision, feel free to back the changes out :) Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** faq.txt 14 Jul 2004 13:10:19 -0000 1.77 --- faq.txt 19 Jul 2004 06:52:37 -0000 1.78 *************** *** 1067,1073 **** you can make it look like whatever you like. You can see a list of what a configuration file of all the defaults would like like if you execute the ! following Python command:: ! python -c "from spambayes.Options import options ; print options.display()" .. _`ConfigParser docs`: http://www.python.org/doc/current/lib/module-ConfigParser.html --- 1067,1075 ---- you can make it look like whatever you like. You can see a list of what a configuration file of all the defaults would like like if you execute the ! following Python command (the wrapping here is just for display - this ! should all be a single line):: ! python -c "from spambayes.Options import options ; ! print options.display()" .. _`ConfigParser docs`: http://www.python.org/doc/current/lib/module-ConfigParser.html *************** *** 1079,1085 **** This depends on exactly what you want to do, and which application you are intending to use. The easiest thing is to execute the following Python ! command:: ! python -c "from spambayes.Options import options ; print options.display_full()" This will print out a complete list of the options, including a description --- 1081,1089 ---- This depends on exactly what you want to do, and which application you are intending to use. The easiest thing is to execute the following Python ! command (the wrapping here is just for display - this ! should all be a single line):: ! python -c "from spambayes.Options import options ; ! print options.display_full()" This will print out a complete list of the options, including a description *************** *** 1087,1103 **** section, if you know its name:: ! python -c "from spambayes.Options import options ; print options.display_full('section_name')" Or just a single option:: ! python -c "from spambayes.Options import options ; print options.display_full('section_name', 'option_name')" If you want a list of all the sections, you can use this command:: ! python -c "from spambayes.Options import options ; print options.sections()" If you want a list of all the options, you can use this command:: ! python -c "from spambayes.Options import options ; print options.options(prepend_section_name=False)" --- 1091,1111 ---- section, if you know its name:: ! python -c "from spambayes.Options import options ; ! print options.display_full('section_name')" Or just a single option:: ! python -c "from spambayes.Options import options ; ! print options.display_full('section_name', 'option_name')" If you want a list of all the sections, you can use this command:: ! python -c "from spambayes.Options import options ; ! print options.sections()" If you want a list of all the options, you can use this command:: ! python -c "from spambayes.Options import options ; ! print options.options(prepend_section_name=False)" *************** *** 1196,1200 **** To use a pickle, set the option "persistent_use_database" to False in your ! `configuration file <#how-do-i-configure-pop3proxy-imapfilter-etc-without-a-web-browser>`_, in the section "Storage" (if you have been using SpamBayes for a while, check that you don't have an old version of this option elsewhere in your --- 1204,1208 ---- To use a pickle, set the option "persistent_use_database" to False in your ! `configuration file <#how-do-i-configure-spambayes>`_, in the section "Storage" (if you have been using SpamBayes for a while, check that you don't have an old version of this option elsewhere in your From anadelonbrin at users.sourceforge.net Mon Jul 19 11:55:23 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Jul 19 11:55:27 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_imapfilter.py,1.33,1.34 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30036/scripts Modified Files: sb_imapfilter.py Log Message: assert is a statement, not a function. (And assert(test, string) will always pass, since the (test, string) tuple always evaluates as True...) Index: sb_imapfilter.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_imapfilter.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** sb_imapfilter.py 14 Jul 2004 08:59:27 -0000 1.33 --- sb_imapfilter.py 19 Jul 2004 09:55:21 -0000 1.34 *************** *** 378,383 **** if self.got_substance: return ! assert(self.id, "Cannot get substance of message without an id") ! assert(self.uid, "Cannot get substance of message without an UID") imap.SelectFolder(self.folder.name) try: --- 378,383 ---- if self.got_substance: return ! assert self.id, "Cannot get substance of message without an id" ! assert self.uid, "Cannot get substance of message without an UID" imap.SelectFolder(self.folder.name) try: *************** *** 494,500 **** # we can't actually update the message with IMAP # so what we do is create a new message and delete the old one ! assert(self.folder is not None, ! "Can't save a message that doesn't have a folder.") ! assert(self.id, "Can't save a message that doesn't have an id.") response = imap.uid("FETCH", self.uid, "(FLAGS INTERNALDATE)") self._check(response, 'fetch (flags internaldate)') --- 494,500 ---- # we can't actually update the message with IMAP # so what we do is create a new message and delete the old one ! assert self.folder is not None,\ ! "Can't save a message that doesn't have a folder." ! assert self.id, "Can't save a message that doesn't have an id." response = imap.uid("FETCH", self.uid, "(FLAGS INTERNALDATE)") self._check(response, 'fetch (flags internaldate)') From anadelonbrin at users.sourceforge.net Mon Jul 19 11:55:24 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Jul 19 11:55:27 2004 Subject: [Spambayes-checkins] spambayes/spambayes FileCorpus.py, 1.15, 1.16 ProxyUI.py, 1.48, 1.49 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30036/spambayes Modified Files: FileCorpus.py ProxyUI.py Log Message: assert is a statement, not a function. (And assert(test, string) will always pass, since the (test, string) tuple always evaluates as True...) Index: FileCorpus.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/FileCorpus.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** FileCorpus.py 16 Jul 2004 01:00:04 -0000 1.15 --- FileCorpus.py 19 Jul 2004 09:55:21 -0000 1.16 *************** *** 201,208 **** def pathname(self): '''Derive the pathname of the message file''' ! assert(self.file_name is not None, ! "Must set filename before using FileMessage instances.") ! assert(self.directory is not None, ! "Must set directory before using FileMessage instances.") return os.path.join(self.directory, self.file_name) --- 201,208 ---- def pathname(self): '''Derive the pathname of the message file''' ! assert self.file_name is not None, \ ! "Must set filename before using FileMessage instances." ! assert self.directory is not None, \ ! "Must set directory before using FileMessage instances." return os.path.join(self.directory, self.file_name) *************** *** 220,225 **** return ! assert(self.file_name is not None, ! "Must set filename before using FileMessage instances.") if options["globals", "verbose"]: --- 220,225 ---- return ! assert self.file_name is not None, \ ! "Must set filename before using FileMessage instances." if options["globals", "verbose"]: *************** *** 246,251 **** '''Write the Message substance to the file''' ! assert(self.file_name is not None, ! "Must set filename before using FileMessage instances.") if options["globals", "verbose"]: --- 246,251 ---- '''Write the Message substance to the file''' ! assert self.file_name is not None, \ ! "Must set filename before using FileMessage instances." if options["globals", "verbose"]: *************** *** 297,308 **** def name(self): '''A unique name for the message''' ! assert(self.file_name is not None, ! "Must set filename before using FileMessage instances.") return self.file_name def key(self): '''The key of this message in the msgs dictionary''' ! assert(self.file_name is not None, ! "Must set filename before using FileMessage instances.") return self.file_name --- 297,308 ---- def name(self): '''A unique name for the message''' ! assert self.file_name is not None, \ ! "Must set filename before using FileMessage instances." return self.file_name def key(self): '''The key of this message in the msgs dictionary''' ! assert self.file_name is not None, \ ! "Must set filename before using FileMessage instances." return self.file_name *************** *** 360,365 **** def store(self): '''Write the Message substance to the file''' ! assert(self.file_name is not None, ! "Must set filename before using FileMessage instances.") if options["globals", "verbose"]: --- 360,365 ---- def store(self): '''Write the Message substance to the file''' ! assert self.file_name is not None, \ ! "Must set filename before using FileMessage instances." if options["globals", "verbose"]: Index: ProxyUI.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** ProxyUI.py 16 Jul 2004 02:02:32 -0000 1.48 --- ProxyUI.py 19 Jul 2004 09:55:21 -0000 1.49 *************** *** 618,623 **** def _contains(self, a, b, ignore_case=False): """Return true if substring b is part of string a.""" ! assert(isinstance(a, types.StringTypes)) ! assert(isinstance(b, types.StringTypes)) if ignore_case: a = a.lower() --- 618,623 ---- def _contains(self, a, b, ignore_case=False): """Return true if substring b is part of string a.""" ! assert isinstance(a, types.StringTypes) ! assert isinstance(b, types.StringTypes) if ignore_case: a = a.lower() From anadelonbrin at users.sourceforge.net Mon Jul 19 11:57:10 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Jul 19 11:57:12 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_server.py,1.24,1.25 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30317/scripts Modified Files: sb_server.py Log Message: Initialise the can_stop variable, so that the test-sb_server script passes again. Index: sb_server.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_server.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** sb_server.py 16 Jul 2004 02:02:32 -0000 1.24 --- sb_server.py 19 Jul 2004 09:57:07 -0000 1.25 *************** *** 637,640 **** --- 637,641 ---- self.platform_mutex = None self.prepared = False + self.can_stop = True self.init() From anadelonbrin at users.sourceforge.net Mon Jul 19 11:59:01 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Jul 19 11:59:04 2004 Subject: [Spambayes-checkins] spambayes/spambayes classifier.py,1.24,1.25 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30623/spambayes Modified Files: classifier.py Log Message: Add some explanation to a couple of asserts. It's possible for users to see these, if things have gone terribly wrong. (in the X-Spambayes-Exception header). Index: classifier.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/classifier.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** classifier.py 14 Jul 2004 07:11:08 -0000 1.24 --- classifier.py 19 Jul 2004 09:58:59 -0000 1.25 *************** *** 306,313 **** nspam = float(self.nspam or 1) ! assert hamcount <= nham hamratio = hamcount / nham ! assert spamcount <= nspam spamratio = spamcount / nspam --- 306,313 ---- nspam = float(self.nspam or 1) ! assert hamcount <= nham, "Token seen in more ham than ham trained." hamratio = hamcount / nham ! assert spamcount <= nspam, "Token seen in more spam than spam trained." spamratio = spamcount / nspam From anadelonbrin at users.sourceforge.net Tue Jul 20 02:52:54 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Tue Jul 20 02:52:57 2004 Subject: [Spambayes-checkins] website faq.txt,1.78,1.79 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29592 Modified Files: faq.txt Log Message: Add a FAQ about the ZoneAlarm/sb_server issue since this is useful information and seems to hit a few people. Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** faq.txt 19 Jul 2004 06:52:37 -0000 1.78 --- faq.txt 20 Jul 2004 00:52:51 -0000 1.79 *************** *** 1478,1481 **** --- 1478,1495 ---- + When viewing the sb_server review page, my computer becomes unresponsive. + ------------------------------------------------------------------------- + + Are you using ZoneAlarm? There is a known issue with version 5.x of + ZoneAlarm (specificially its TrueVector service) that causes problems with + the SpamBayes review page. We're told that the ZoneAlarm technical support + people recommend a clean uninstall of ZoneAlarm and reverting to version + 4.5.594.000 of ZoneAlarm, which works fine with SpamBayes. + + We're also told that ZoneAlarm are aware of the issue with their 5.x + release and were working on it, but that it might be the next release before + they have it solved. + + Development =========== From anadelonbrin at users.sourceforge.net Wed Jul 21 00:20:00 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Jul 21 00:20:03 2004 Subject: [Spambayes-checkins] website download.ht, 1.26, 1.27 windows.ht, 1.39, 1.40 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15233 Modified Files: download.ht windows.ht Log Message: I'm sure I already checked this in...update for the 1.0 release to match the other pages. (The 1.0 release is only waiting on the binary to be built. I'm keeping the old version of the website pushed until then, and will update as soon as that's done. I thought that this would have been sooner, otherwise would have held off checking this in, sorry.) Index: download.ht =================================================================== RCS file: /cvsroot/spambayes/website/download.ht,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** download.ht 26 Jun 2004 06:57:07 -0000 1.26 --- download.ht 20 Jul 2004 22:19:57 -0000 1.27 *************** *** 3,9 **** Author: SpamBayes !

              Version 1.0 (Release Candidate 2) of the SpamBayes project is now available. !

              The purpose of this release is solely to shake out those last few bugs on the way to a final 1.0 ! release - assuming no problems are found, a 1.0 release will follow in a few days. Feedback to spambayes@python.org. --- 3,12 ---- Author: SpamBayes !

              Version 1.0 of the SpamBayes project is now available. !

              This is the final 1.0 release of SpamBayes. We expect it to prove to be ! quite stable and usable by most people. As time permits, we will endeavour ! to fix any remaining bugs and eventually a 1.0.1 release will be made. ! However, work can now begin on a 1.1 release, which may include many new ! (possibly even exciting!) features. Feedback to spambayes@python.org. Index: windows.ht =================================================================== RCS file: /cvsroot/spambayes/website/windows.ht,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** windows.ht 26 Jun 2004 06:57:07 -0000 1.39 --- windows.ht 20 Jul 2004 22:19:57 -0000 1.40 *************** *** 8,17 **** and for all other mail clients !

              Outlook 2000/XP/2003

              Latest Release

              !

              The latest release is 1.0rc2 - see the release notes ! or download the installation program.

              --- 8,17 ---- and for all other mail clients !

              Outlook 2000/2002(XP)/2003

              Latest Release

              !

              The latest release is 1.0 - see the release notes ! or download the installation program.

              *************** *** 51,55 ****
            • Mark Hammond's win32all extensions. Choose the version which corresponds to the version of Python you downloaded.
            • --- 51,55 ----
            • Mark Hammond's pywin32 extensions. Choose the version which corresponds to the version of Python you downloaded.
            • *************** *** 58,63 **** href="http://sourceforge.net/project/showfiles.php?group_id=61702">zip file or via ! CVS. The zip file will probably be easier to handle, but there are ! several improvements to the code which make the CVS version a viable option (though you will have to have a CVS client for Windows installed). --- 58,63 ---- href="http://sourceforge.net/project/showfiles.php?group_id=61702">zip file or via ! CVS. The zip file will probably be easier to handle, but there may ! be improvements to the code which make the CVS version a viable option (though you will have to have a CVS client for Windows installed). *************** *** 66,70 ****

              Once you have all three bits downloaded, run the Python installer then ! the win32all installer. Finally, double-click the addin.py script in the Outlook2000 folder of the SpamBayes distribution and you should be good to go. See the README.txt file in the Outlook2000 directory for more details

              --- 66,70 ----

              Once you have all three bits downloaded, run the Python installer then ! the pywin32 installer. Finally, double-click the addin.py script in the Outlook2000 folder of the SpamBayes distribution and you should be good to go. See the README.txt file in the Outlook2000 directory for more details

              *************** *** 74,78 ****

              Windows users using other mail clients and retrieving mail via POP3 can now download the same ! installation program and use it to install a binary version of sb_server, including a tray application.

              --- 74,78 ----

              Windows users using other mail clients and retrieving mail via POP3 can now download the same ! installation program and use it to install a binary version of sb_server, including a tray application.

              From kpitt at users.sourceforge.net Wed Jul 21 20:58:54 2004 From: kpitt at users.sourceforge.net (Kenny Pitt) Date: Wed Jul 21 20:58:57 2004 Subject: [Spambayes-checkins] spambayes/spambayes Options.py,1.109,1.110 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31047 Modified Files: Options.py Log Message: There are 3 different "allow_remote_connections" options for the Web UI, the POP3 proxy, and the SMTP proxy. Unfortunately, they all had the same display name so they looked the same on the Advanced Configuration page except for subtle differences in the help text. Changed display names to show "UI connections", "POP3 connections", and "SMTP connections" so that they have unique labels. Index: Options.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Options.py,v retrieving revision 1.109 retrieving revision 1.110 diff -C2 -d -r1.109 -r1.110 *** Options.py 16 Jul 2004 02:00:35 -0000 1.109 --- Options.py 21 Jul 2004 18:58:51 -0000 1.110 *************** *** 798,802 **** SERVER, DO_NOT_RESTORE), ! ("allow_remote_connections", "Allowed remote connections", "localhost", """Enter a list of trusted IPs, separated by commas. Remote POP connections from any of them will be allowed. You can trust any --- 798,802 ---- SERVER, DO_NOT_RESTORE), ! ("allow_remote_connections", "Allowed remote POP3 connections", "localhost", """Enter a list of trusted IPs, separated by commas. Remote POP connections from any of them will be allowed. You can trust any *************** *** 836,840 **** SERVER, DO_NOT_RESTORE), ! ("allow_remote_connections", "Allowed remote connections", "localhost", """Enter a list of trusted IPs, separated by commas. Remote SMTP connections from any of them will be allowed. You can trust any --- 836,840 ---- SERVER, DO_NOT_RESTORE), ! ("allow_remote_connections", "Allowed remote SMTP connections", "localhost", """Enter a list of trusted IPs, separated by commas. Remote SMTP connections from any of them will be allowed. You can trust any *************** *** 893,897 **** BOOLEAN, RESTORE), ! ("allow_remote_connections", "Allowed remote connections", "localhost", """Enter a list of trusted IPs, separated by commas. Remote connections from any of them will be allowed. You can trust any --- 893,897 ---- BOOLEAN, RESTORE), ! ("allow_remote_connections", "Allowed remote UI connections", "localhost", """Enter a list of trusted IPs, separated by commas. Remote connections from any of them will be allowed. You can trust any From anadelonbrin at users.sourceforge.net Thu Jul 22 03:10:29 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Jul 22 03:10:32 2004 Subject: [Spambayes-checkins] website faq.txt,1.79,1.80 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9628 Modified Files: faq.txt Log Message: Add a "where is my recover from spam button" FAQ. No-one seems to answer me saying "oh yes, that was it" when I give this answer, but it should be right, and putting it here saves me typing it again and again and again. If anyone can think of any other reasons the button might not appear, please add them! Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** faq.txt 20 Jul 2004 00:52:51 -0000 1.79 --- faq.txt 22 Jul 2004 01:10:27 -0000 1.80 *************** *** 779,782 **** --- 779,805 ---- + The "Recover From Spam" button no longer appears. + ------------------------------------------------- + + First, check that Outlook isn't hiding it for you. If toolbars run out of + space, Outlook automatically hides buttons for you (we have no control over + which buttons are hidden). If this has happened there will be little + down-arrows at the end of the toolbar - click those and the missing button + will appear. To stop this happening, you have to move the SpamBayes toolbar + to somewhere where there will always be room for the three buttons. + + Next, check that you're in the right folder. This button only appears + when you are in the 'unsure' and 'spam' folders. Open up the SpamBayes + Manager dialog, and go to the Filtering tab. Click the browse button next + to the 'unsure' and 'spam' folders and write down the hierarchy to get to + the selected folder (for example, "Personal Folders->Inbox->Possible Junk"). + Now, close the Manager dialog, and, in Outlook, navigate to the folders + based on the hierarchy that you wrote down (to make sure that you aren't in + another folder with the same name). + + If neither of these works, then please submit a bug report, attaching a copy + of your most recent log file. + + How do I uninstall the plug-in? ------------------------------- From anadelonbrin at users.sourceforge.net Thu Jul 22 05:20:28 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Jul 22 05:20:31 2004 Subject: [Spambayes-checkins] website server_side.ht,1.4,1.5 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26542 Modified Files: server_side.ht Log Message: Add link to Dave Abrahams' notes about doing server side with imapfilter and sb_filter. I meant to do this ages ago, but have only just got around to it... Index: server_side.ht =================================================================== RCS file: /cvsroot/spambayes/website/server_side.ht,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** server_side.ht 7 Jan 2004 06:19:08 -0000 1.4 --- server_side.ht 22 Jul 2004 03:20:26 -0000 1.5 *************** *** 123,124 **** --- 123,131 ---- their Rules. They're willing to put up with one or two mis-classified emails in order to have 95% of their junk email not in their Inbox.

              + +

              Setting up Server-Side Spam filtering for IMAP

              +

              Dave Abrahams has put together + + notes explaining how he set up server-side filtering with SpamBayes and + an IMAP server, using imapfilter.py (now sb_imapfilter.py) and + hammiefilter.py (now sb_filter.py).

              From anadelonbrin at users.sourceforge.net Thu Jul 22 07:51:22 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Jul 22 07:51:30 2004 Subject: [Spambayes-checkins] spambayes/spambayes Version.py,1.31,1.32 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11029/spambayes Modified Files: Version.py Log Message: If there is no username/password specified then the proxy handler should be in the form "http://@server:port". We had a colon before the @, which works fine with Python 2.3, but not Python 2.4a1 (I'm happy to believe that the new form is more correct). This is with my proxy, at least :) Index: Version.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Version.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Version.py 4 May 2004 04:26:12 -0000 1.31 --- Version.py 22 Jul 2004 05:51:20 -0000 1.32 *************** *** 138,146 **** else: port = 8080 ! username = options["globals", "proxy_username"] ! password = options["globals", "proxy_password"] proxy_support = urllib2.ProxyHandler({"http" : ! "http://%s:%s@%s:%d" % \ ! (username, password, server, port)}) opener = urllib2.build_opener(proxy_support, urllib2.HTTPHandler) --- 138,150 ---- else: port = 8080 ! if options["globals", "proxy_username"]: ! user_pass_string = "%s:%s" % \ ! (options["globals", "proxy_username"], ! options["globals", "proxy_password"]) ! else: ! user_pass_string = "" proxy_support = urllib2.ProxyHandler({"http" : ! "http://%s@%s:%d" % \ ! (user_pass_string, server, port)}) opener = urllib2.build_opener(proxy_support, urllib2.HTTPHandler) From anadelonbrin at users.sourceforge.net Thu Jul 22 07:57:00 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Jul 22 07:57:03 2004 Subject: [Spambayes-checkins] spambayes/windows pop3proxy_tray.py,1.21,1.22 Message-ID: Update of /cvsroot/spambayes/spambayes/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11756/windows Modified Files: pop3proxy_tray.py Log Message: Drat, I thought we were doing this already. Do what the Outlook plug-in does and give the user the "string" version of the version number, as it's less confusing at the moment. One day the version system will be revised, and we won't need to worry.... :) Index: pop3proxy_tray.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/windows/pop3proxy_tray.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** pop3proxy_tray.py 30 Jun 2004 23:10:38 -0000 1.21 --- pop3proxy_tray.py 22 Jul 2004 05:56:56 -0000 1.22 *************** *** 538,542 **** return ! self.ShowMessage("Current version is %s, latest is %s." % (cur_ver_num, latest_ver_num)) if latest_ver_num > cur_ver_num: url = get_version_string(app_name, "Download Page", version_dict=latest) --- 538,543 ---- return ! self.ShowMessage("Current version is %s, latest is %s." % \ ! (cur_ver_string, latest_ver_string)) if latest_ver_num > cur_ver_num: url = get_version_string(app_name, "Download Page", version_dict=latest) From anadelonbrin at users.sourceforge.net Fri Jul 23 01:25:46 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Fri Jul 23 01:25:49 2004 Subject: [Spambayes-checkins] spambayes/spambayes Version.py,1.32,1.33 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24741/spambayes Modified Files: Version.py Log Message: The proxy port needs to be an integer, not a string. Index: Version.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Version.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Version.py 22 Jul 2004 05:51:20 -0000 1.32 --- Version.py 22 Jul 2004 23:25:43 -0000 1.33 *************** *** 136,139 **** --- 136,140 ---- if ':' in server: server, port = server.split(':', 1) + port = int(port) else: port = 8080 From montanaro at users.sourceforge.net Fri Jul 23 06:57:56 2004 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Fri Jul 23 06:58:16 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_bnfilter.py,1.2,1.3 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5253 Modified Files: sb_bnfilter.py Log Message: nit Index: sb_bnfilter.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_bnfilter.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** sb_bnfilter.py 20 Apr 2004 09:25:59 -0000 1.2 --- sb_bnfilter.py 23 Jul 2004 04:57:54 -0000 1.3 *************** *** 110,114 **** filename = arg ! if len(args) != 0: usage(2) --- 110,114 ---- filename = arg ! if args: usage(2) From montanaro at users.sourceforge.net Fri Jul 23 07:00:09 2004 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Fri Jul 23 07:00:12 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_mboxtrain.py,1.12,1.13 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5562 Modified Files: sb_mboxtrain.py Log Message: typo Index: sb_mboxtrain.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_mboxtrain.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** sb_mboxtrain.py 25 May 2004 23:16:39 -0000 1.12 --- sb_mboxtrain.py 23 Jul 2004 05:00:06 -0000 1.13 *************** *** 60,64 **** """Return an email Message object. ! This works like mboxutis.get_message, except it doesn't junk the headers if there's an error. Doing so would cause a headerless message to be written back out! --- 60,64 ---- """Return an email Message object. ! This works like mboxutils.get_message, except it doesn't junk the headers if there's an error. Doing so would cause a headerless message to be written back out! From montanaro at users.sourceforge.net Sun Jul 25 05:00:55 2004 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Sun Jul 25 05:00:58 2004 Subject: [Spambayes-checkins] spambayes/contrib tte.py,1.11,1.12 Message-ID: Update of /cvsroot/spambayes/spambayes/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3684 Modified Files: tte.py Log Message: Add --ratio=N flag to allow the user to adjust the ratio of spam to ham. Seems unfortunately necessary in this spam-heavy world we live in. Index: tte.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/contrib/tte.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** tte.py 10 Jul 2004 02:59:41 -0000 1.11 --- tte.py 25 Jul 2004 03:00:53 -0000 1.12 *************** *** 23,31 **** all messages score correctly. ! -c ext - Cull all messages which aren't used as training input during any run ! and write to new ham and spam files with ext as an extra file extension. ! All messages which are never considered (because one training set is ! longer than the other or the -m flag was used to reduce the amount of ! input) are retained. -o sect:opt:val - --- 23,31 ---- all messages score correctly. ! -c ext - Cull all messages which aren't used as training input during any ! run and write to new ham and spam files with ext as an extra file ! extension. All messages which are never considered (because one ! training set is longer than the other or the -m flag was used to ! reduce the amount of input) are retained. -o sect:opt:val - *************** *** 36,39 **** --- 36,43 ---- -R Walk backwards through the mailbox. + --ratio=n Define the number of spam messages to be trained for each ham. + The default is 1, but given the sorry state of the Net's email + infrastructure these days you'll probably want to raise it. Keep + it as close to 1 as you can... Note: The -c command line argument isn't quite as benign as it might first *************** *** 91,95 **** return iter(seq) ! def train(store, ham, spam, maxmsgs, maxrounds, tdict, reverse, verbose): smisses = hmisses = round = 0 ham_cutoff = Options.options["Categorization", "ham_cutoff"] --- 95,100 ---- return iter(seq) ! def train(store, hambox, spambox, maxmsgs, maxrounds, tdict, reverse, verbose, ! ratio): smisses = hmisses = round = 0 ham_cutoff = Options.options["Categorization", "ham_cutoff"] *************** *** 97,102 **** while round < maxrounds and (hmisses or smisses or round == 0): ! hambone = mboxutils.getmbox(ham) ! spamcan = mboxutils.getmbox(spam) if reverse: hambone = reversed(list(hambone)) --- 102,107 ---- while round < maxrounds and (hmisses or smisses or round == 0): ! hambone = mboxutils.getmbox(hambox) ! spamcan = mboxutils.getmbox(spambox) if reverse: hambone = reversed(list(hambone)) *************** *** 111,124 **** try: while not maxmsgs or nmsgs < maxmsgs: ! hammsg = hambone.next() ! spammsg = spamcan.next() ! nmsgs += 2 sys.stdout.write("\r%5d" % nmsgs) sys.stdout.flush() ! score = store.spamprob(tokenize(hammsg)) ! selector = (hammsg["message-id"] or ! hammsg["subject"]) if score > ham_cutoff and selector is not None: if verbose: --- 116,137 ---- try: while not maxmsgs or nmsgs < maxmsgs: ! ham = hambone.next() ! spams = [] ! for i in range(ratio): ! try: ! spams.append(spamcan.next()) ! except StopIteration: ! # no spams left so exit ! if not spams: ! raise ! # use what we've collected ! break ! nmsgs += 1 + len(spams) sys.stdout.write("\r%5d" % nmsgs) sys.stdout.flush() ! score = store.spamprob(tokenize(ham)) ! selector = ham["message-id"] or ham["subject"] if score > ham_cutoff and selector is not None: if verbose: *************** *** 126,142 **** score, selector) hmisses += 1 ! tdict[hammsg["message-id"]] = True ! store.learn(tokenize(hammsg), False) ! score = store.spamprob(tokenize(spammsg)) ! selector = (spammsg["message-id"] or ! spammsg["subject"]) ! if score < spam_cutoff and selector is not None: ! if verbose: ! print >> sys.stderr, "miss spam: %.6f %s" % ( ! score, selector) ! smisses += 1 ! tdict[spammsg["message-id"]] = True ! store.learn(tokenize(spammsg), True) except StopIteration: --- 139,156 ---- score, selector) hmisses += 1 ! tdict[ham["message-id"]] = True ! store.learn(tokenize(ham), False) ! for spam in spams: ! score = store.spamprob(tokenize(spam)) ! selector = (spam["message-id"] or ! spam["subject"]) ! if score < spam_cutoff and selector is not None: ! if verbose: ! print >> sys.stderr, "miss spam: %.6f %s" % ( ! score, selector) ! smisses += 1 ! tdict[spam["message-id"]] = True ! store.learn(tokenize(spam), True) except StopIteration: *************** *** 176,180 **** "database=", "pickle=", "verbose", "option=", "max=", "maxrounds=", ! "cullext=", "reverse"]) except getopt.GetoptError, msg: usage(msg) --- 190,194 ---- "database=", "pickle=", "verbose", "option=", "max=", "maxrounds=", ! "cullext=", "reverse", "ratio="]) except getopt.GetoptError, msg: usage(msg) *************** *** 186,189 **** --- 200,204 ---- verbose = False reverse = False + sh_ratio = 1 for opt, arg in opts: if opt in ("-h", "--help"): *************** *** 206,209 **** --- 221,226 ---- elif opt in ('-o', '--option'): Options.options.set_from_cmdline(arg, sys.stderr) + elif opt == '--ratio': + sh_ratio = int(arg) if ham is None or spam is None: *************** *** 221,225 **** tdict = {} ! train(store, ham, spam, maxmsgs, maxrounds, tdict, reverse, verbose) store.store() --- 238,243 ---- tdict = {} ! train(store, ham, spam, maxmsgs, maxrounds, tdict, reverse, verbose, ! sh_ratio) store.store() From anadelonbrin at users.sourceforge.net Mon Jul 26 01:43:35 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Jul 26 01:43:39 2004 Subject: [Spambayes-checkins] spambayes/Outlook2000 train.py,1.35,1.36 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17787/Outlook2000 Modified Files: train.py Log Message: There really isn't any need to force people to select both a ham and a spam folder when doing manual training, and some people will want to just do one and not the other. Remove the restriction that enforced this, and change the error message appropriately. If one isn't selected, then the generator just ends up empty, so no other changes are necessary as far as I can tell (and testing seems to back that up). Index: train.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/train.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** train.py 16 Dec 2003 05:06:33 -0000 1.35 --- train.py 25 Jul 2004 23:43:33 -0000 1.36 *************** *** 129,134 **** rescore = config.training.rescore ! if not config.training.ham_folder_ids or not config.training.spam_folder_ids: ! progress.error("You must specify at least one spam, and one good folder") return --- 129,134 ---- rescore = config.training.rescore ! if not config.training.ham_folder_ids and not config.training.spam_folder_ids: ! progress.error("You must specify at least one spam or one good folder") return *************** *** 151,155 **** # We do this in possibly 3 stages - train, filter, save ! # re-scoring is much slower and training (as we actually have to save # the message back.) # Saving is really slow sometimes, but we only have 1 tick for that anyway --- 151,155 ---- # We do this in possibly 3 stages - train, filter, save ! # re-scoring is much slower than training (as we actually have to save # the message back.) # Saving is really slow sometimes, but we only have 1 tick for that anyway From montanaro at users.sourceforge.net Mon Jul 26 04:46:52 2004 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Mon Jul 26 04:46:55 2004 Subject: [Spambayes-checkins] spambayes/contrib tte.py,1.12,1.13 Message-ID: Update of /cvsroot/spambayes/spambayes/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12291 Modified Files: tte.py Log Message: Generalize the spam:ham ratio flag to include the ham value instead of having it be implicitly 1. Index: tte.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/contrib/tte.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** tte.py 25 Jul 2004 03:00:53 -0000 1.12 --- tte.py 26 Jul 2004 02:46:49 -0000 1.13 *************** *** 36,43 **** -R Walk backwards through the mailbox. ! --ratio=n Define the number of spam messages to be trained for each ham. ! The default is 1, but given the sorry state of the Net's email ! infrastructure these days you'll probably want to raise it. Keep ! it as close to 1 as you can... Note: The -c command line argument isn't quite as benign as it might first --- 36,43 ---- -R Walk backwards through the mailbox. ! --ratio=n Define the ratio of spam:ham messages to be trained at once. ! The default is 1:1, but given the sorry state of the Net's email ! infrastructure these days you'll probably want to raise it (3:2 or ! 2:1, etc). Keep it as close to 1 as you can... Note: The -c command line argument isn't quite as benign as it might first *************** *** 101,104 **** --- 101,106 ---- spam_cutoff = Options.options["Categorization", "spam_cutoff"] + nspam, nham = ratio + while round < maxrounds and (hmisses or smisses or round == 0): hambone = mboxutils.getmbox(hambox) *************** *** 116,122 **** try: while not maxmsgs or nmsgs < maxmsgs: ! ham = hambone.next() spams = [] ! for i in range(ratio): try: spams.append(spamcan.next()) --- 118,134 ---- try: while not maxmsgs or nmsgs < maxmsgs: ! hams = [] ! for i in range(nham): ! try: ! hams.append(hambone.next()) ! except StopIteration: ! # no hams left so exit ! if not hams: ! raise ! # use what we've collected ! break ! spams = [] ! for i in range(nspam): try: spams.append(spamcan.next()) *************** *** 128,144 **** break ! nmsgs += 1 + len(spams) sys.stdout.write("\r%5d" % nmsgs) sys.stdout.flush() ! score = store.spamprob(tokenize(ham)) ! selector = ham["message-id"] or ham["subject"] ! if score > ham_cutoff and selector is not None: ! if verbose: ! print >> sys.stderr, "miss ham: %.6f %s" % ( ! score, selector) ! hmisses += 1 ! tdict[ham["message-id"]] = True ! store.learn(tokenize(ham), False) for spam in spams: --- 140,157 ---- break ! nmsgs += len(hams) + len(spams) sys.stdout.write("\r%5d" % nmsgs) sys.stdout.flush() ! for ham in hams: ! score = store.spamprob(tokenize(ham)) ! selector = ham["message-id"] or ham["subject"] ! if score > ham_cutoff and selector is not None: ! if verbose: ! print >> sys.stderr, "miss ham: %.6f %s" % ( ! score, selector) ! hmisses += 1 ! tdict[ham["message-id"]] = True ! store.learn(tokenize(ham), False) for spam in spams: *************** *** 200,204 **** verbose = False reverse = False ! sh_ratio = 1 for opt, arg in opts: if opt in ("-h", "--help"): --- 213,217 ---- verbose = False reverse = False ! sh_ratio = (1, 1) for opt, arg in opts: if opt in ("-h", "--help"): *************** *** 222,226 **** Options.options.set_from_cmdline(arg, sys.stderr) elif opt == '--ratio': ! sh_ratio = int(arg) if ham is None or spam is None: --- 235,240 ---- Options.options.set_from_cmdline(arg, sys.stderr) elif opt == '--ratio': ! arg = arg.split(":") ! sh_ratio = (int(arg[0]), int(arg[1])) if ham is None or spam is None: From kpitt at users.sourceforge.net Tue Jul 27 16:44:46 2004 From: kpitt at users.sourceforge.net (Kenny Pitt) Date: Tue Jul 27 16:44:50 2004 Subject: [Spambayes-checkins] spambayes/Outlook2000/docs/images manager-select.jpg, 1.3, 1.4 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/docs/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8397/images Modified Files: manager-select.jpg Log Message: Update menu capture image to show the new "Empty Spam Folder" menu item. Index: manager-select.jpg =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/docs/images/manager-select.jpg,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvshO9n0P and /tmp/cvsQXtYqk differ From kpitt at users.sourceforge.net Tue Jul 27 16:44:46 2004 From: kpitt at users.sourceforge.net (Kenny Pitt) Date: Tue Jul 27 16:44:52 2004 Subject: [Spambayes-checkins] spambayes/Outlook2000/docs welcome.html, 1.8, 1.9 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8397 Modified Files: welcome.html Log Message: Update menu capture image to show the new "Empty Spam Folder" menu item. Index: welcome.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/docs/welcome.html,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** welcome.html 29 Jun 2004 13:05:47 -0000 1.8 --- welcome.html 27 Jul 2004 14:44:43 -0000 1.9 *************** *** 74,96 **** for more information.

              Using the Plugin

              ! ! ! ! ! ! ! !
              This section describes how the plugin operates once it is configured. You can access the SpamBayes features from the SpamBayes toolbar (shown to the right), but ! in general, SpamBayes will simply and silently filter your mail.
              !
              !
              SpamBayes Toolbar
              !
              !

              As messages arrive, they are given a spam score. This score is --- 74,83 ---- for more information.

              Using the Plugin

              ! SpamBayes Toolbar !

              This section describes how the plugin operates once it is configured. You can access the SpamBayes features from the SpamBayes toolbar (shown to the right), but ! in general, SpamBayes will simply and silently filter your mail.

              As messages arrive, they are given a spam score. This score is