From montanaro at projects.sourceforge.net Mon Feb 2 08:29:44 2004 From: montanaro at projects.sourceforge.net (Skip Montanaro) Date: Mon Feb 2 08:31:41 2004 Subject: [Spambayes-checkins] spambayes/spambayes classifier.py,1.21,1.22 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13077 Modified Files: classifier.py Log Message: add enumerate() for 2.2 compatibility Index: classifier.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/classifier.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** classifier.py 12 Jan 2004 08:38:23 -0000 1.21 --- classifier.py 2 Feb 2004 13:29:42 -0000 1.22 *************** *** 57,60 **** --- 57,66 ---- from email import message_from_string + try: + enumerate + except NameError: + def enumerate(seq): + return zip(range(len(seq)), seq) + DOMAIN_AND_PORT_RE = re.compile(r"([^:/\\]+)(:([\d]+))?") HTTP_ERROR_RE = re.compile(r"HTTP Error ([\d]+)") From anadelonbrin at users.sourceforge.net Tue Feb 3 20:34:56 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Tue Feb 3 20:37:09 2004 Subject: [Spambayes-checkins] spambayes/testtools timcv.py,1.5,1.6 Message-ID: Update of /cvsroot/spambayes/spambayes/testtools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19979/testtools Modified Files: timcv.py Log Message: Typo. Index: timcv.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/testtools/timcv.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** timcv.py 12 Jan 2004 08:36:15 -0000 1.5 --- timcv.py 4 Feb 2004 01:34:54 -0000 1.6 *************** *** 73,79 **** print options.display() ! hamdirs = [get_pathname_options("TestDriver", "ham_directories") % \ i for i in range(1, nsets+1)] ! spamdirs = [get_pathname_options("TestDriver", "spam_directories") % \ i for i in range(1, nsets+1)] --- 73,79 ---- print options.display() ! hamdirs = [get_pathname_option("TestDriver", "ham_directories") % \ i for i in range(1, nsets+1)] ! spamdirs = [get_pathname_option("TestDriver", "spam_directories") % \ i for i in range(1, nsets+1)] From kpitt at users.sourceforge.net Wed Feb 4 10:50:02 2004 From: kpitt at users.sourceforge.net (Kenny Pitt) Date: Wed Feb 4 10:52:21 2004 Subject: [Spambayes-checkins] spambayes/spambayes Version.py,1.26,1.27 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14702 Modified Files: Version.py Log Message: Clean up version descriptions a little, and remove unused version info for SMTP Proxy (now part of sb_server). Index: Version.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Version.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Version.py 23 Dec 2003 03:17:01 -0000 1.26 --- Version.py 4 Feb 2004 15:49:59 -0000 1.27 *************** *** 17,21 **** LATEST_VERSION_HOME="http://spambayes.sourceforge.net/download/Version.cfg" ! # This module is part of the spambayes project, which is Copyright 2002-3 # The Python Software Foundation and is covered by the Python Software # Foundation license. --- 17,21 ---- LATEST_VERSION_HOME="http://spambayes.sourceforge.net/download/Version.cfg" ! # This module is part of the spambayes project, which is Copyright 2002-4 # The Python Software Foundation and is covered by the Python Software # Foundation license. *************** *** 23,38 **** # Non app specific - changed when "spambayes\*" changes significantly "Version": 0.2, ! "Description": "SpamBayes Beta2", "Date": "July 2003", ! "Full Description": "%(Description)s, version %(Version)s (%(Date)s)", # Sub-dict for application specific version strings. "Apps": { ! # Should this be here? I'm not sure that anything uses it, and the ! # hammie.py script is gone. A sb_filter version might be better. ! "Hammie" : { "Version": 0.1, ! "Description": "SpamBayes command line tool (Hammie) Beta1", "Date": "January 2003", ! "Full Description": "%(Description)s, version %(Version)s (%(Date)s)", }, "Outlook" : { --- 23,36 ---- # Non app specific - changed when "spambayes\*" changes significantly "Version": 0.2, ! "Description": "SpamBayes Engine", "Date": "July 2003", ! "Full Description": "%(Description)s Version %(Version)s (%(Date)s)", # Sub-dict for application specific version strings. "Apps": { ! "sb_filter" : { "Version": 0.1, ! "Description": "SpamBayes Command Line Filter", "Date": "January 2003", ! "Full Description": "%(Description)s Version %(Version)s (%(Date)s)", }, "Outlook" : { *************** *** 41,47 **** "Description": "SpamBayes Outlook Addin", "Date": "December 2003", ! "Full Description": "%(Description)s, version %(Version)s (%(Date)s)", "Full Description Binary": ! "%(Description)s, Binary version %(BinaryVersion)s (%(Date)s)", # Note this means we can change the download page later, and old # versions will still go to the new page. --- 39,45 ---- "Description": "SpamBayes Outlook Addin", "Date": "December 2003", ! "Full Description": "%(Description)s Version %(Version)s (%(Date)s)", "Full Description Binary": ! "%(Description)s Binary Version %(BinaryVersion)s (%(Date)s)", # Note this means we can change the download page later, and old # versions will still go to the new page. *************** *** 52,64 **** "Version": 0.3, "BinaryVersion": 0.2, ! "Description": "SpamBayes POP3 Proxy Beta3", "Date": "December 2003", "InterfaceVersion": 0.03, ! "InterfaceDescription": "SpamBayes POP3 Proxy Web Interface Alpha3", ! "Full Description": """%(Description)s, version %(Version)s (%(Date)s), ! using %(InterfaceDescription)s, version %(InterfaceVersion)s""", "Full Description Binary": ! """%(Description)s, Binary version %(BinaryVersion)s (%(Date)s), ! using %(InterfaceDescription)s, version %(InterfaceVersion)s""", # Note this means we can change the download page later, and old # versions will still go to the new page. --- 50,62 ---- "Version": 0.3, "BinaryVersion": 0.2, ! "Description": "SpamBayes POP3 Proxy", "Date": "December 2003", "InterfaceVersion": 0.03, ! "InterfaceDescription": "POP3 Proxy Web Interface", ! "Full Description": """%(Description)s Version %(Version)s (%(Date)s), ! using %(InterfaceDescription)s Version %(InterfaceVersion)s""", "Full Description Binary": ! """%(Description)s Binary Version %(BinaryVersion)s (%(Date)s), ! using %(InterfaceDescription)s Version %(InterfaceVersion)s""", # Note this means we can change the download page later, and old # versions will still go to the new page. *************** *** 68,98 **** "Lotus Notes Filter" : { "Version": 0.01, ! "Description": "SpamBayes Lotus Notes Filter Alpha1", "Date": "March 2003", ! "Full Description": "%(Description)s, version %(Version)s (%(Date)s)", ! }, ! "SMTP Proxy" : { ! "Version": 0.1, ! "Description": "SpamBayes SMTP Proxy Beta1", ! "Date": "September 2003", ! "Full Description": "%(Description)s, version %(Version)s (%(Date)s)", }, "IMAP Filter" : { "Version": 0.1, ! "Description": "SpamBayes IMAP Filter Beta1", "Date": "September 2003", "InterfaceVersion": 0.02, ! "InterfaceDescription": "SpamBayes IMAP Filter Web Interface Alpha2", ! "Full Description": """%(Description)s, version %(Version)s (%(Date)s), ! using %(InterfaceDescription)s, version %(InterfaceVersion)s""", }, "IMAP Server" : { "Version": 0.01, ! "Description": "SpamBayes IMAP Server Alpha1", "Date": "September 2003", "InterfaceVersion": 0.02, ! "InterfaceDescription": "SpamBayes IMAP Server Web Interface Alpha2", ! "Full Description": """%(Description)s, version %(Version)s (%(Date)s), ! using %(InterfaceDescription)s, version %(InterfaceVersion)s""", }, }, --- 66,90 ---- "Lotus Notes Filter" : { "Version": 0.01, ! "Description": "SpamBayes Lotus Notes Filter", "Date": "March 2003", ! "Full Description": "%(Description)s Version %(Version)s (%(Date)s)", }, "IMAP Filter" : { "Version": 0.1, ! "Description": "SpamBayes IMAP Filter", "Date": "September 2003", "InterfaceVersion": 0.02, ! "InterfaceDescription": "IMAP Filter Web Interface", ! "Full Description": """%(Description)s Version %(Version)s (%(Date)s), ! using %(InterfaceDescription)s Version %(InterfaceVersion)s""", }, "IMAP Server" : { "Version": 0.01, ! "Description": "SpamBayes IMAP Server", "Date": "September 2003", "InterfaceVersion": 0.02, ! "InterfaceDescription": "IMAP Server Web Interface", ! "Full Description": """%(Description)s Version %(Version)s (%(Date)s), ! using %(InterfaceDescription)s Version %(InterfaceVersion)s""", }, }, *************** *** 207,216 **** make_cfg(sys.stdout) sys.exit(0) ! print "SpamBayes version is:", get_version_string() # Enumerate applications print print "Application versions:" for app in versions["Apps"]: ! print "%s: %s" % (app, get_version_string(app)) print --- 199,208 ---- make_cfg(sys.stdout) sys.exit(0) ! print "SpamBayes engine version:", get_version_string() # Enumerate applications print print "Application versions:" for app in versions["Apps"]: ! print "\n%s: %s" % (app, get_version_string(app)) print *************** *** 225,234 **** print ! print "SpamBayes version is:", get_version_string(version_dict=latest_dict) # Enumerate applications print print "Application versions:" for app in latest_dict["Apps"]: ! print "%s: %s" % (app, get_version_string(app, version_dict=latest_dict)) if __name__=='__main__': --- 217,226 ---- print ! print "SpamBayes engine version:", get_version_string(version_dict=latest_dict) # Enumerate applications print print "Application versions:" for app in latest_dict["Apps"]: ! print "\n%s: %s" % (app, get_version_string(app, version_dict=latest_dict)) if __name__=='__main__': From kpitt at users.sourceforge.net Wed Feb 4 10:51:24 2004 From: kpitt at users.sourceforge.net (Kenny Pitt) Date: Wed Feb 4 10:53:42 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_filter.py,1.9,1.10 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14938 Modified Files: sb_filter.py Log Message: Print version information when displaying the usage. Index: sb_filter.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_filter.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** sb_filter.py 12 Jan 2004 08:36:15 -0000 1.9 --- sb_filter.py 4 Feb 2004 15:51:22 -0000 1.10 *************** *** 79,82 **** --- 79,83 ---- import getopt from spambayes import hammie, Options, mboxutils + from spambayes.Version import get_version_string try: *************** *** 126,129 **** --- 127,135 ---- def usage(code, msg=''): """Print usage message and sys.exit(code).""" + # Include version info in usage + print >> sys.stderr, get_version_string("sb_filter") + print >> sys.stderr, " with engine %s" % get_version_string() + print >> sys.stderr + if msg: print >> sys.stderr, msg From anadelonbrin at users.sourceforge.net Wed Feb 4 20:16:03 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Feb 4 20:18:26 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_imapfilter.py,1.22,1.23 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19557/scripts Modified Files: sb_imapfilter.py Log Message: Fix [ 890645 ] imapfilter: "ValueError: year out of range" This guy was getting mail dated almost 2000 years ago (or 8000 years in the future, maybe, but it would be nice to think there won't be any spam then ) and that choked mktime(). Fix that so that the fallback of the current time is used in that situation. Index: sb_imapfilter.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_imapfilter.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** sb_imapfilter.py 27 Jan 2004 08:36:51 -0000 1.22 --- sb_imapfilter.py 5 Feb 2004 01:16:01 -0000 1.23 *************** *** 341,344 **** --- 341,355 ---- try: return Time2Internaldate(time.mktime(parsed_date)) + except ValueError: + # Invalid dates can cause mktime() to raise a + # ValueError, for example: + # >>> time.mktime(parsedate("Mon, 06 May 0102 10:51:16 -0100")) + # Traceback (most recent call last): + # File "", line 1, in ? + # ValueError: year out of range + # (Why this person is getting mail from almost two + # thousand years ago is another question ). + # In any case, we just pass and use the current date. + pass except OverflowError: pass From anadelonbrin at users.sourceforge.net Wed Feb 4 20:31:58 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Wed Feb 4 20:34:19 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_imapfilter.py,1.23,1.24 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23730/scripts Modified Files: sb_imapfilter.py Log Message: imapfilter has been adding two mailid headers, so stop that. Fixing the 'multiple ids' bug broke the fix for the 'no ids' bug, so fix it so that both work. Index: sb_imapfilter.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_imapfilter.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** sb_imapfilter.py 5 Feb 2004 01:16:01 -0000 1.23 --- sb_imapfilter.py 5 Feb 2004 01:31:55 -0000 1.24 *************** *** 473,482 **** "(\\Deleted \\Seen)") self._check(response, 'store') ! new_id = multiple_ids[-1] ! ! # Let's hope it doesn't, but, just in case, if the search ! # turns up empty, we make the assumption that the new ! # message is the last one with a recent flag ! if new_id == "": response = imap.uid("SEARCH", "RECENT") new_id = response[1][0] --- 473,482 ---- "(\\Deleted \\Seen)") self._check(response, 'store') ! if multiple_ids: ! new_id = multiple_ids[-1] ! else: ! # Let's hope it doesn't, but, just in case, if the search ! # turns up empty, we make the assumption that the new ! # message is the last one with a recent flag response = imap.uid("SEARCH", "RECENT") new_id = response[1][0] *************** *** 634,637 **** --- 634,638 ---- evidence=True) # add headers and remember classification + msg.delSBHeaders() msg.addSBHeaders(prob, clues) From anadelonbrin at users.sourceforge.net Thu Feb 5 03:13:28 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Feb 5 03:15:53 2004 Subject: [Spambayes-checkins] spambayes WHAT_IS_NEW.txt,1.25,1.26 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5122 Modified Files: WHAT_IS_NEW.txt Log Message: ** Incompatible change ** Let's call this 1.0a9, because 7+1 is a bad number, and that makes us match the Outlook plug-in. In imapfilter, hint at a good imaplib debug level, and don't put the todo list in the docstring. If the allowed values for an option is a tuple of values, then the type is correct if the value is one of those types. Also remove duplicate code from OptionsClass.py Get all the scripts to determine the database name and type via a utility function in storage.py, so that everything is consistent across scripts (and it removes some code duplication, although the options list is looped through twice). The consistent style is to use "-p FILE" for pickle FILE, and "-d FILE" for dbm FILE. The two scripts that already used -p now use -P instead (imapfilter, notesfilter). Dumped the "mysql::"/"pgsql::" format for electing to use mySQL/pgSQL (I doubt anyone is using this, anyway). Replaced it with a proper selection, by making the persistent_use_database option multi-choice, instead of boolean (it's backwards compatible, so that True/"True" and False/"False" are "dbm" and "pickle", respectively). This also provides room for a "zodb" option, at some point . I've tested all the scripts except for notesfilter, which doesn't want to run here, and hammie/hammiebulk. (By tested, I mean that I've run them far enough to see that they're opening the correct db with -p/-d/none and raising an error with both -p and -d). That said, testing by day-to-day users of the scripts would be great. Fixes [ 824628 ] sb_dbexpimp.py, sb_filter.py option incompatibility Closes [857595] Same argument on the command line Closes [857597] On command line use -D for pickle Closes [861656] Missing file for patch Index: WHAT_IS_NEW.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/WHAT_IS_NEW.txt,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** WHAT_IS_NEW.txt 12 Jan 2004 23:39:42 -0000 1.25 --- WHAT_IS_NEW.txt 5 Feb 2004 08:13:25 -0000 1.26 *************** *** 10,16 **** noted in the "Transition" section. ! New in Alpha Release 8 ====================== -------------------------- ** Incompatible changes ** --- 10,26 ---- noted in the "Transition" section. ! New in Alpha Release 9 ====================== + ------------------------------------ + ** What happened to Alpha Release 8? + ------------------------------------ + + There was no Alpha Release 8! Apart from 8 being a very dangerous number + , we wanted to match the version numbers of the binary releases, as + this time that includes more than just the Outlook plug-in, and we are + going to attempt to release source and binary roughly simultaneously. This + should hopefully make things clearer when discussing the various versions. + -------------------------- ** Incompatible changes ** *************** *** 30,33 **** --- 40,60 ---- configuration so that it points to the correct place. + o Specifying the database name and type is now consistent across all + scripts. Use "-p FILE" for a pickle, and "-d FILE" for a dbm. We + still recommend setting these in a configuration file, rather than + via the command line, so that if they change you remain unaffected. + + o The -p option for sb_imapfilter.py (to specify the password manually) + is now -P (-p is universally used to signal that a pickle is to be used). + + o The -p option for sb_notesfilter.py (to prompt before ending) is now + -P (-p is universally used to signal that a pickle is to be used). + + o The experimental (and probably unused) format for specifying that + MySQL or PostgrepSQL should be used for the database ("mysql::" and + "pgsql::") has been removed. These are now set like any other database + type, using the persistent_use_database option (these cannot be set via + the command line). + There should be no other incompatible changes (from 1.0a7) in this release. From anadelonbrin at users.sourceforge.net Thu Feb 5 03:13:29 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Feb 5 03:15:57 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_dbexpimp.py, 1.5, 1.6 sb_filter.py, 1.10, 1.11 sb_imapfilter.py, 1.24, 1.25 sb_mboxtrain.py, 1.10, 1.11 sb_notesfilter.py, 1.6, 1.7 sb_server.py, 1.19, 1.20 sb_xmlrpcserver.py, 1.5, 1.6 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5122/scripts Modified Files: sb_dbexpimp.py sb_filter.py sb_imapfilter.py sb_mboxtrain.py sb_notesfilter.py sb_server.py sb_xmlrpcserver.py Log Message: ** Incompatible change ** Let's call this 1.0a9, because 7+1 is a bad number, and that makes us match the Outlook plug-in. In imapfilter, hint at a good imaplib debug level, and don't put the todo list in the docstring. If the allowed values for an option is a tuple of values, then the type is correct if the value is one of those types. Also remove duplicate code from OptionsClass.py Get all the scripts to determine the database name and type via a utility function in storage.py, so that everything is consistent across scripts (and it removes some code duplication, although the options list is looped through twice). The consistent style is to use "-p FILE" for pickle FILE, and "-d FILE" for dbm FILE. The two scripts that already used -p now use -P instead (imapfilter, notesfilter). Dumped the "mysql::"/"pgsql::" format for electing to use mySQL/pgSQL (I doubt anyone is using this, anyway). Replaced it with a proper selection, by making the persistent_use_database option multi-choice, instead of boolean (it's backwards compatible, so that True/"True" and False/"False" are "dbm" and "pickle", respectively). This also provides room for a "zodb" option, at some point . I've tested all the scripts except for notesfilter, which doesn't want to run here, and hammie/hammiebulk. (By tested, I mean that I've run them far enough to see that they're opening the correct db with -p/-d/none and raising an error with both -p and -d). That said, testing by day-to-day users of the scripts would be great. Fixes [ 824628 ] sb_dbexpimp.py, sb_filter.py option incompatibility Closes [857595] Same argument on the command line Closes [857597] On command line use -D for pickle Closes [861656] Missing file for patch Index: sb_dbexpimp.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_dbexpimp.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sb_dbexpimp.py 15 Jan 2004 03:18:06 -0000 1.5 --- sb_dbexpimp.py 5 Feb 2004 08:13:26 -0000 1.6 *************** *** 48,53 **** -v : verbose mode (some additional diagnostic messages) -f: FN : flat file to export to or import from ! -d: FN : name of pickled database file to use ! -D: FN : name of dbm database file to use -m : merge import into an existing database file. This is meaningful only for import. If omitted, a new database --- 48,53 ---- -v : verbose mode (some additional diagnostic messages) -f: FN : flat file to export to or import from ! -p: FN : name of pickled database file to use ! -f: FN : name of dbm database file to use -m : merge import into an existing database file. This is meaningful only for import. If omitted, a new database *************** *** 63,80 **** Export pickled mybayes.db into mybayes.db.export as a csv flat file ! sb_dbexpimp -e -d mybayes.db -f mybayes.db.export ! Import mybayes.eb.export into a new DBM mybayes.db ! sb_dbexpimp -i -D mybayes.db -f mybayes.db.export Export, then import (reorganize) new pickled mybayes.db ! sb_dbexpimp -e -i -n -d mybayes.db -f mybayes.db.export Convert a bayes database from pickle to DBM ! sb_dbexpimp -e -d abayes.db -f abayes.export ! sb_dbexpimp -i -D abayes.db -f abayes.export ! Create a new database (newbayes.db) from two ! databases (abayes.db, bbayes.db) sb_dbexpimp -e -d abayes.db -f abayes.export sb_dbexpimp -e -d bbayes.db -f bbayes.export --- 63,80 ---- Export pickled mybayes.db into mybayes.db.export as a csv flat file ! sb_dbexpimp -e -p mybayes.db -f mybayes.db.export ! Import mybayes.db.export into a new DBM mybayes.db ! sb_dbexpimp -i -d mybayes.db -f mybayes.db.export Export, then import (reorganize) new pickled mybayes.db ! sb_dbexpimp -e -i -n -p mybayes.db -f mybayes.db.export Convert a bayes database from pickle to DBM ! sb_dbexpimp -e -p abayes.db -f abayes.export ! sb_dbexpimp -i -d abayes.db -f abayes.export ! Create a new DBM database (newbayes.db) from two ! DBM databases (abayes.db, bbayes.db) sb_dbexpimp -e -d abayes.db -f abayes.export sb_dbexpimp -e -d bbayes.db -f bbayes.export *************** *** 116,126 **** def runExport(dbFN, useDBM, outFN): ! ! if useDBM: ! bayes = spambayes.storage.DBDictClassifier(dbFN) words = bayes.db.keys() words.remove(bayes.statekey) else: - bayes = spambayes.storage.PickledClassifier(dbFN) words = bayes.wordinfo.keys() --- 116,124 ---- def runExport(dbFN, useDBM, outFN): ! bayes = spambayes.storage.open_storage(dbFN, useDBM) ! if useDBM == "dbm": words = bayes.db.keys() words.remove(bayes.statekey) else: words = bayes.wordinfo.keys() *************** *** 170,177 **** raise ! if useDBM: ! bayes = spambayes.storage.DBDictClassifier(dbFN) ! else: ! bayes = spambayes.storage.PickledClassifier(dbFN) try: --- 168,172 ---- raise ! bayes = spambayes.storage.open_storage(dbFN, useDBM) try: *************** *** 216,220 **** fp.close() ! print "Storing database, please be patient. Even moderately large" print "databases may take a very long time to store." bayes.store() --- 211,215 ---- fp.close() ! print "Storing database, please be patient. Even moderately sized" print "databases may take a very long time to store." bayes.store() *************** *** 236,245 **** try: ! opts, args = getopt.getopt(sys.argv[1:], 'iehmvd:D:f:o:') except getopt.error, msg: print >>sys.stderr, str(msg) + '\n\n' + __doc__ sys.exit() - usePickle = False useDBM = False newDBM = True --- 231,239 ---- try: ! opts, args = getopt.getopt(sys.argv[1:], 'iehmvd:p:f:o:') except getopt.error, msg: print >>sys.stderr, str(msg) + '\n\n' + __doc__ sys.exit() useDBM = False newDBM = True *************** *** 253,262 **** print >>sys.stderr, __doc__ sys.exit() - elif opt == '-d': - useDBM = False - dbFN = arg - elif opt == '-D': - useDBM = True - dbFN = arg elif opt == '-f': flatFN = arg --- 247,250 ---- *************** *** 271,274 **** --- 259,263 ---- elif opt in ('-o', '--option'): options.set_from_cmdline(arg, sys.stderr) + dbFN, useDBM = spambayes.storage.database_type(opts) if (dbFN and flatFN): Index: sb_filter.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_filter.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** sb_filter.py 4 Feb 2004 15:51:22 -0000 1.10 --- sb_filter.py 5 Feb 2004 08:13:26 -0000 1.11 *************** *** 24,28 **** -d DBFILE use database in DBFILE ! -D PICKLEFILE use pickle (instead of database) in PICKLEFILE -n --- 24,28 ---- -d DBFILE use database in DBFILE ! -p PICKLEFILE use pickle (instead of database) in PICKLEFILE -n *************** *** 78,82 **** import sys import getopt ! from spambayes import hammie, Options, mboxutils from spambayes.Version import get_version_string --- 78,82 ---- import sys import getopt ! from spambayes import hammie, Options, mboxutils, storage from spambayes.Version import get_version_string *************** *** 152,158 **** options.merge_files(['/etc/hammierc', os.path.expanduser('~/.hammierc')]) ! self.dbname = Options.get_pathname_option("Storage", ! "persistent_storage_file") ! self.usedb = options["Storage", "persistent_use_database"] def newdb(self): --- 152,156 ---- options.merge_files(['/etc/hammierc', os.path.expanduser('~/.hammierc')]) ! self.dbname, self.usedb = storage.database_type([]) def newdb(self): *************** *** 192,196 **** h = HammieFilter() actions = [] ! opts, args = getopt.getopt(sys.argv[1:], 'hxd:D:nfgstGSo:', ['help', 'examples', 'option=']) create_newdb = False --- 190,194 ---- h = HammieFilter() actions = [] ! opts, args = getopt.getopt(sys.argv[1:], 'hxd:p:nfgstGSo:', ['help', 'examples', 'option=']) create_newdb = False *************** *** 202,211 **** elif opt in ('-o', '--option'): Options.options.set_from_cmdline(arg, sys.stderr) - elif opt == '-d': - h.usedb = True - h.dbname = arg - elif opt == '-D': - h.usedb = False - h.dbname = arg elif opt == '-f': actions.append(h.filter) --- 200,203 ---- *************** *** 222,225 **** --- 214,218 ---- elif opt == "-n": create_newdb = True + h.dbname, h.usedb = storage.database_type(opts) if create_newdb: Index: sb_imapfilter.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_imapfilter.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** sb_imapfilter.py 5 Feb 2004 01:31:55 -0000 1.24 --- sb_imapfilter.py 5 Feb 2004 08:13:26 -0000 1.25 *************** *** 14,27 **** options: ! -d dbname : pickled training database filename ! -D dbname : dbm training database filename -t : train contents of spam folder and ham folder -c : classify inbox -h : help -v : verbose mode ! -p : security option to prompt for imap password, rather than look in options["imap", "password"] -e y/n : expunge/purge messages on exit (y) or not (n) -i debuglvl : a somewhat mysterious imaplib debugging level -l minutes : period of time between filtering operations -b : Launch a web browser showing the user interface. --- 14,28 ---- options: ! -p dbname : pickled training database filename ! -d dbname : dbm training database filename -t : train contents of spam folder and ham folder -c : classify inbox -h : help -v : verbose mode ! -P : security option to prompt for imap password, rather than look in options["imap", "password"] -e y/n : expunge/purge messages on exit (y) or not (n) -i debuglvl : a somewhat mysterious imaplib debugging level + (4 is a good level, and suitable for bug reports) -l minutes : period of time between filtering operations -b : Launch a web browser showing the user interface. *************** *** 34,44 **** Classify inbox, with dbm database ! sb_imapfilter -c -D bayes.db Train Spam and Ham, then classify inbox, with dbm database ! sb_imapfilter -t -c -D bayes.db Train Spam and Ham only, with pickled database ! sb_imapfilter -t -d bayes.db Warnings: --- 35,45 ---- Classify inbox, with dbm database ! sb_imapfilter -c -d bayes.db Train Spam and Ham, then classify inbox, with dbm database ! sb_imapfilter -t -c -d bayes.db Train Spam and Ham only, with pickled database ! sb_imapfilter -t -p bayes.db Warnings: *************** *** 57,61 **** --- 58,64 ---- mail flagged as such, *or* if you set the imap_expunge option to True, then this mail will be irretrievably lost. + """ + todo = """ To Do: o IMAPMessage and IMAPFolder currently carry out very simple checks *************** *** 63,67 **** "OK", then the filter terminates. Handling of these errors could be much nicer. ! o IMAP over SSL is untested. o Develop a test script, like spambayes/test/test_pop3proxy.py that runs through some tests (perhaps with a *real* imap server, rather --- 66,70 ---- "OK", then the filter terminates. Handling of these errors could be much nicer. ! o IMAP over SSL is relatively untested. o Develop a test script, like spambayes/test/test_pop3proxy.py that runs through some tests (perhaps with a *real* imap server, rather *************** *** 728,738 **** global imap try: ! opts, args = getopt.getopt(sys.argv[1:], 'hbtcvpl:e:i:d:D:o:') except getopt.error, msg: print >>sys.stderr, str(msg) + '\n\n' + __doc__ sys.exit() - bdbname = get_pathname_option("Storage", "persistent_storage_file") - useDBM = options["Storage", "persistent_use_database"] doTrain = False doClassify = False --- 731,739 ---- global imap try: ! opts, args = getopt.getopt(sys.argv[1:], 'hbPtcvl:e:i:d:p:o:') except getopt.error, msg: print >>sys.stderr, str(msg) + '\n\n' + __doc__ sys.exit() doTrain = False doClassify = False *************** *** 749,763 **** print >>sys.stderr, __doc__ sys.exit() - elif opt == '-d': - useDBM = False - bdbname = arg - elif opt == '-D': - useDBM = True - bdbname = arg elif opt == "-b": launchUI = True elif opt == '-t': doTrain = True ! elif opt == '-p': promptForPass = True elif opt == '-c': --- 750,758 ---- print >>sys.stderr, __doc__ sys.exit() elif opt == "-b": launchUI = True elif opt == '-t': doTrain = True ! elif opt == '-P': promptForPass = True elif opt == '-c': *************** *** 776,779 **** --- 771,775 ---- elif opt == '-o': options.set_from_cmdline(arg, sys.stderr) + bdbname, useDBM = storage.database_type(opts) # Let the user know what they are using... *************** *** 787,792 **** """ - bdbname = os.path.expanduser(bdbname) - if options["globals", "verbose"]: print "Loading database %s..." % (bdbname), --- 783,786 ---- Index: sb_mboxtrain.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_mboxtrain.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** sb_mboxtrain.py 29 Jan 2004 14:37:23 -0000 1.10 --- sb_mboxtrain.py 5 Feb 2004 08:13:26 -0000 1.11 *************** *** 17,22 **** creating it is slower, but loading it is much faster, especially for large word databases. Recommended for use with ! s_filter or any procmail-based filter. ! -D DBNAME use the pickle store. A pickle is smaller and faster to create, but much slower to load. Recommended for use with sb_server and --- 17,22 ---- creating it is slower, but loading it is much faster, especially for large word databases. Recommended for use with ! sb_filter or any procmail-based filter. ! -p DBNAME use the pickle store. A pickle is smaller and faster to create, but much slower to load. Recommended for use with sb_server and *************** *** 51,55 **** import sys, os, getopt, email import shutil ! from spambayes import hammie from spambayes.Options import options, get_pathname_option --- 51,55 ---- import sys, os, getopt, email import shutil ! from spambayes import hammie, storage from spambayes.Options import options, get_pathname_option *************** *** 290,294 **** try: ! opts, args = getopt.getopt(sys.argv[1:], 'hfqnrd:D:g:s:o:') except getopt.error, msg: usage(2, msg) --- 290,294 ---- try: ! opts, args = getopt.getopt(sys.argv[1:], 'hfqnrd:p:g:s:o:') except getopt.error, msg: usage(2, msg) *************** *** 297,302 **** usage(2, "No options given") - pck = None - usedb = None force = False trainnew = False --- 297,300 ---- *************** *** 319,330 **** elif opt == "-r": removetrained = True - elif opt == "-d": - usedb = True - pck = arg - elif opt == "-D": - usedb = False - pck = arg elif opt == '-o': options.set_from_cmdline(arg, sys.stderr) if args: usage(2, "Positional arguments not allowed") --- 317,323 ---- elif opt == "-r": removetrained = True elif opt == '-o': options.set_from_cmdline(arg, sys.stderr) + pck, usedb = storage.database_type(opts) if args: usage(2, "Positional arguments not allowed") Index: sb_notesfilter.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_notesfilter.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sb_notesfilter.py 15 Jan 2004 03:29:16 -0000 1.6 --- sb_notesfilter.py 5 Feb 2004 08:13:26 -0000 1.7 *************** *** 84,89 **** options: ! -d dbname : pickled training database filename ! -D dbname : dbm training database filename -l dbname : database filename of local mail replica e.g. localmail.nsf --- 84,89 ---- options: ! -p dbname : pickled training database filename ! -d dbname : dbm training database filename -l dbname : database filename of local mail replica e.g. localmail.nsf *************** *** 99,103 **** -c : classify inbox -h : help ! -p : prompt "Press Enter to end" before ending This is useful for automated executions where the statistics output would otherwise be lost when the --- 99,103 ---- -c : classify inbox -h : help ! -P : prompt "Press Enter to end" before ending This is useful for automated executions where the statistics output would otherwise be lost when the *************** *** 122,129 **** o Create correct folders if they do not exist o Options for some of this stuff? ! o pop3proxy style training/configuration interface? o parameter to retrain? o Suggestions? ! ''' # This module is part of the spambayes project, which is Copyright 2002 --- 122,129 ---- o Create correct folders if they do not exist o Options for some of this stuff? ! o sb_server style training/configuration interface? o parameter to retrain? o Suggestions? ! ''' # This module is part of the spambayes project, which is Copyright 2002 *************** *** 288,296 **** def run(bdbname, useDBM, ldbname, rdbname, foldname, doTrain, doClassify): ! ! if useDBM: ! bayes = storage.DBDictClassifier(bdbname) ! else: ! bayes = storage.PickledClassifier(bdbname) try: --- 288,292 ---- def run(bdbname, useDBM, ldbname, rdbname, foldname, doTrain, doClassify): ! bayes = storage.open_database(bdbname, useDBM) try: *************** *** 347,356 **** try: ! opts, args = getopt.getopt(sys.argv[1:], 'htcpd:D:l:r:f:o:') except getopt.error, msg: print >>sys.stderr, str(msg) + '\n\n' + __doc__ sys.exit() - bdbname = None # bayes database name ldbname = None # local notes database name rdbname = None # remote notes database location --- 343,351 ---- try: ! opts, args = getopt.getopt(sys.argv[1:], 'htcPd:p:l:r:f:o:') except getopt.error, msg: print >>sys.stderr, str(msg) + '\n\n' + __doc__ sys.exit() ldbname = None # local notes database name rdbname = None # remote notes database location *************** *** 364,373 **** print >>sys.stderr, __doc__ sys.exit() - elif opt == '-d': - useDBM = False - bdbname = arg - elif opt == '-D': - useDBM = True - bdbname = arg elif opt == '-l': ldbname = arg --- 359,362 ---- *************** *** 380,387 **** elif opt == '-c': doClassify = True ! elif opt == '-p': doPrompt = True elif opt == '-o': options.set_from_cmdline(arg, sys.stderr) if (bdbname and ldbname and sbfname and (doTrain or doClassify)): --- 369,377 ---- elif opt == '-c': doClassify = True ! elif opt == '-P': doPrompt = True elif opt == '-o': options.set_from_cmdline(arg, sys.stderr) + bdbname, useDBM = storage.database_type(opts) if (bdbname and ldbname and sbfname and (doTrain or doClassify)): Index: sb_server.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_server.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** sb_server.py 15 Jan 2004 03:34:56 -0000 1.19 --- sb_server.py 5 Feb 2004 08:13:26 -0000 1.20 *************** *** 20,24 **** -h : Displays this help message. -d FILE : use the named DBM database file ! -D FILE : the the named Pickle database file -l port : proxy listens on this port number (default 110) -u port : User interface listens on this port number --- 20,24 ---- -h : Displays this help message. -d FILE : use the named DBM database file ! -p FILE : the the named Pickle database file -l port : proxy listens on this port number (default 110) -u port : User interface listens on this port number *************** *** 640,644 **** # Load up the other settings from Option.py / bayescustomize.ini - self.useDB = options["Storage", "persistent_use_database"] self.uiPort = options["html_ui", "port"] self.launchUI = options["html_ui", "launch_browser"] --- 640,643 ---- *************** *** 726,736 **** print "Loading database...", if self.isTest: ! self.useDB = True ! options["Storage", "persistent_storage_file"] = \ ! '_pop3proxy_test.pickle' # This is never saved. ! filename = get_pathname_option("Storage", "persistent_storage_file") ! filename = os.path.expanduser(filename) ! self.bayes = storage.open_storage(filename, self.useDB) ! self.buildStatusStrings() --- 725,734 ---- print "Loading database...", if self.isTest: ! self.useDB = "pickle" ! self.DBName = '_pop3proxy_test.pickle' # This is never saved. ! if not hasattr(self, "DBName"): ! self.DBName, self.useDB = storage.database_type([]) ! self.bayes = storage.open_storage(self.DBName, self.useDB) ! self.buildStatusStrings() *************** *** 884,890 **** def run(): # Read the arguments. try: ! opts, args = getopt.getopt(sys.argv[1:], 'hbpsd:D:l:u:o:') except getopt.error, msg: print >>sys.stderr, str(msg) + '\n\n' + __doc__ --- 882,889 ---- def run(): + global state # Read the arguments. try: ! opts, args = getopt.getopt(sys.argv[1:], 'hbpsd:p:l:u:o:') except getopt.error, msg: print >>sys.stderr, str(msg) + '\n\n' + __doc__ *************** *** 898,911 **** elif opt == '-b': state.launchUI = True - elif opt == '-d': # dbm file - state.useDB = True - options["Storage", "persistent_storage_file"] = arg - elif opt == '-D': # pickle file - state.useDB = False - options["Storage", "persistent_storage_file"] = arg - elif opt == '-p': # dead option - print >>sys.stderr, "-p option is no longer supported, use -D\n" - print >>sys.stderr, __doc__ - sys.exit() elif opt == '-l': state.proxyPorts = [_addressAndPort(arg)] --- 897,900 ---- *************** *** 915,918 **** --- 904,909 ---- options.set_from_cmdline(arg, sys.stderr) + state.DBName, state.useDB = storage.database_type(opts) + # Let the user know what they are using... print get_version_string("POP3 Proxy") Index: sb_xmlrpcserver.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_xmlrpcserver.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sb_xmlrpcserver.py 15 Jan 2004 03:40:24 -0000 1.5 --- sb_xmlrpcserver.py 5 Feb 2004 08:13:26 -0000 1.6 *************** *** 10,17 **** show usage and exit -p FILE ! use file as the persistent store. loads data from this file if it ! exists, and saves data to this file at the end. ! -d ! use the DBM store instead of cPickle. -o section:option:value set [section, option] in the options database to value --- 10,17 ---- show usage and exit -p FILE ! use pickle FILE as the persistent store. loads data from this file ! if it exists, and saves data to this file at the end. ! -d FILE ! use DBM store FILE as the persistent store. -o section:option:value set [section, option] in the options database to value *************** *** 31,35 **** from spambayes import hammie, Options ! from spambayes.storage import open_storage try: --- 31,35 ---- from spambayes import hammie, Options ! from spambayes import storage try: *************** *** 74,78 **** """Main program; parse options and go.""" try: ! opts, args = getopt.getopt(sys.argv[1:], 'hdp:o:') except getopt.error, msg: usage(2, msg) --- 74,78 ---- """Main program; parse options and go.""" try: ! opts, args = getopt.getopt(sys.argv[1:], 'hd:p:o:') except getopt.error, msg: usage(2, msg) *************** *** 80,95 **** options = Options.options - dbname = Options.get_pathname_option("Storage", - "persistent_storage_file") - usedb = options["Storage", "persistent_use_database"] for opt, arg in opts: if opt == '-h': usage(0) - elif opt == '-p': - dbname = arg - elif opt == "-d": - usedb = True elif opt == '-o': options.set_from_cmdline(arg, sys.stderr) if len(args) != 1: --- 80,89 ---- options = Options.options for opt, arg in opts: if opt == '-h': usage(0) elif opt == '-o': options.set_from_cmdline(arg, sys.stderr) + dbname, usedb = storage.database_type(opts) if len(args) != 1: *************** *** 99,103 **** port = int(port) ! bayes = open_storage(dbname, usedb) h = XMLHammie(bayes) --- 93,97 ---- port = int(port) ! bayes = storage.open_storage(dbname, usedb) h = XMLHammie(bayes) From anadelonbrin at users.sourceforge.net Thu Feb 5 03:13:31 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Feb 5 03:15:58 2004 Subject: [Spambayes-checkins] spambayes/spambayes Options.py, 1.103, 1.104 OptionsClass.py, 1.21, 1.22 hammie.py, 1.13, 1.14 hammiebulk.py, 1.13, 1.14 storage.py, 1.38, 1.39 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5122/spambayes Modified Files: Options.py OptionsClass.py hammie.py hammiebulk.py storage.py Log Message: ** Incompatible change ** Let's call this 1.0a9, because 7+1 is a bad number, and that makes us match the Outlook plug-in. In imapfilter, hint at a good imaplib debug level, and don't put the todo list in the docstring. If the allowed values for an option is a tuple of values, then the type is correct if the value is one of those types. Also remove duplicate code from OptionsClass.py Get all the scripts to determine the database name and type via a utility function in storage.py, so that everything is consistent across scripts (and it removes some code duplication, although the options list is looped through twice). The consistent style is to use "-p FILE" for pickle FILE, and "-d FILE" for dbm FILE. The two scripts that already used -p now use -P instead (imapfilter, notesfilter). Dumped the "mysql::"/"pgsql::" format for electing to use mySQL/pgSQL (I doubt anyone is using this, anyway). Replaced it with a proper selection, by making the persistent_use_database option multi-choice, instead of boolean (it's backwards compatible, so that True/"True" and False/"False" are "dbm" and "pickle", respectively). This also provides room for a "zodb" option, at some point . I've tested all the scripts except for notesfilter, which doesn't want to run here, and hammie/hammiebulk. (By tested, I mean that I've run them far enough to see that they're opening the correct db with -p/-d/none and raising an error with both -p and -d). That said, testing by day-to-day users of the scripts would be great. Fixes [ 824628 ] sb_dbexpimp.py, sb_filter.py option incompatibility Closes [857595] Same argument on the command line Closes [857597] On command line use -D for pickle Closes [861656] Missing file for patch Index: Options.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Options.py,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** Options.py 29 Jan 2004 15:02:11 -0000 1.103 --- Options.py 5 Feb 2004 08:13:26 -0000 1.104 *************** *** 543,551 **** # loaded by the appropriate application only. "Storage" : ( ! ("persistent_use_database", "Use database for storage", True, """SpamBayes can use either a database (quick to score one message) ! or a pickle (quick to train on huge amounts of messages). Set this to ! use a database by default.""", ! BOOLEAN, RESTORE), ("persistent_storage_file", "Storage file name", "hammie.db", --- 543,557 ---- # loaded by the appropriate application only. "Storage" : ( ! ("persistent_use_database", "Use database for storage", "dbm", """SpamBayes can use either a database (quick to score one message) ! or a pickle (quick to train on huge amounts of messages). There is ! also (currently experimental) the ability to use a mySQL or ! PostgrepSQL database. For historical reasons, if you set this to ! "True" you are selecting "dbm" and if you set this to "False" you ! are selecting "pickle". We recommend explicitly selecting the type, ! (i.e. changing "True" to "dbm" and "False" to "pickle", or sticking ! with the default.""", ! # True == "dbm", False == "pickle", "True" == "dbm", "False" == "pickle" ! ("mysql", "pgsql", "dbm", "pickle", "True", "False", True, False), RESTORE), ("persistent_storage_file", "Storage file name", "hammie.db", Index: OptionsClass.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/OptionsClass.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** OptionsClass.py 16 Dec 2003 05:06:34 -0000 1.21 --- OptionsClass.py 5 Feb 2004 08:13:27 -0000 1.22 *************** *** 245,248 **** --- 245,252 ---- # already the correct type return value + if type(self.allowed_values) == types.TupleType and \ + value in self.allowed_values: + # already correct type + return value if self.is_boolean(): if str(value) == "True" or value == 1: *************** *** 512,517 **** def convert_and_set(self, section, option, value): - if self.multiple_values_allowed(section, option): - value = self.convert(section, option, value) value = self.convert(section, option, value) self.set(section, option, value) --- 516,519 ---- Index: hammie.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/hammie.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** hammie.py 26 Nov 2003 23:01:24 -0000 1.13 --- hammie.py 5 Feb 2004 08:13:27 -0000 1.14 *************** *** 257,267 **** ! def open(filename, useDB=True, mode='r'): """Open a file, returning a Hammie instance. ! If usedb is False, open as a pickle instead of a DBDict. mode is ! ! used as the flag to open DBDict objects. 'c' for read-write (create ! if needed), 'r' for read-only, 'w' for read-write. """ return Hammie(storage.open_storage(filename, useDB, mode)) --- 257,265 ---- ! def open(filename, useDB="dbm", mode='r'): """Open a file, returning a Hammie instance. ! mode is used as the flag to open DBDict objects. 'c' for read-write ! (create if needed), 'r' for read-only, 'w' for read-write. """ return Hammie(storage.open_storage(filename, useDB, mode)) Index: hammiebulk.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/hammiebulk.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** hammiebulk.py 12 Jan 2004 14:15:38 -0000 1.13 --- hammiebulk.py 5 Feb 2004 08:13:27 -0000 1.14 *************** *** 6,22 **** -h show usage and exit ! -d use the DBM store. A DBM file is larger than the pickle and creating it is slower, but loading it is much faster, especially for large word databases. Recommended for use with hammiefilter or any procmail-based filter. ! -D ! use the pickle store. A pickle is smaller and faster to create, ! but much slower to load. Recommended for use with pop3proxy and ! hammiesrv. -p FILE ! use file as the persistent store. loads data from this file if it ! exists, and saves data to this file at the end. ! Default: %(DEFAULTDB)s -U Untrain instead of train. The interpretation of -g and -s remains --- 6,20 ---- -h show usage and exit ! -d FILE use the DBM store. A DBM file is larger than the pickle and creating it is slower, but loading it is much faster, especially for large word databases. Recommended for use with hammiefilter or any procmail-based filter. ! Default filename: %(DEFAULTDB)s -p FILE ! use the pickle store. A pickle is smaller and faster to create, ! but much slower to load. Recommended for use with sb_server and ! sb_xmlrpcserver. ! Default filename: %(DEFAULTDB)s -U Untrain instead of train. The interpretation of -g and -s remains *************** *** 53,57 **** from spambayes.Options import options, get_pathname_option ! from spambayes import classifier, mboxutils, hammie, Corpus Corpus.Verbose = True --- 51,55 ---- from spambayes.Options import options, get_pathname_option ! from spambayes import classifier, mboxutils, hammie, Corpus, storage Corpus.Verbose = True *************** *** 145,149 **** """Main program; parse options and go.""" try: ! opts, args = getopt.getopt(sys.argv[1:], 'hdDUfg:s:p:u:r') except getopt.error, msg: usage(2, msg) --- 143,147 ---- """Main program; parse options and go.""" try: ! opts, args = getopt.getopt(sys.argv[1:], 'hd:Ufg:s:p:u:r') except getopt.error, msg: usage(2, msg) *************** *** 170,179 **** spam.append(arg) mode = 'c' - elif opt == '-p': - pck = arg - elif opt == "-d": - usedb = True - elif opt == "-D": - usedb = False elif opt == "-f": do_filter = True --- 168,171 ---- *************** *** 184,187 **** --- 176,180 ---- elif opt == '-r': reverse = 1 + pck, usedb = storage.database_type(opts) if args: usage(2, "Positional arguments not allowed") Index: storage.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/storage.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** storage.py 24 Dec 2003 04:08:38 -0000 1.38 --- storage.py 5 Feb 2004 08:13:27 -0000 1.39 *************** *** 66,70 **** import types from spambayes import classifier ! from spambayes.Options import options import cPickle as pickle import errno --- 66,70 ---- import types from spambayes import classifier ! from spambayes.Options import options, get_pathname_option import cPickle as pickle import errno *************** *** 638,641 **** --- 638,645 ---- return repr(self.invalid_name) + class MutuallyExclusiveError(Exception): + def __str__(self): + return "Only one type of database can be specified" + # values are classifier class and True if it accepts a mode # arg, False otherwise *************** *** 646,650 **** } ! def open_storage(data_source_name, useDB=True, mode=None): """Return a storage object appropriate to the given parameters. --- 650,654 ---- } ! def open_storage(data_source_name, db_type="dbm", mode=None): """Return a storage object appropriate to the given parameters. *************** *** 652,671 **** the same given the same options. ! If useDB is false, a pickle will be used, otherwise if the data ! source name includes "::", whatever is before that determines ! the type of database. If the source name doesn't include "::", ! then a DBDictClassifier is used.""" ! if useDB: ! if data_source_name.find('::') != -1: ! db_type, rest = data_source_name.split('::', 1) ! if _storage_types.has_key(db_type.lower()): ! klass, supports_mode = _storage_types[db_type.lower()] ! data_source_name = rest ! else: ! raise NoSuchClassifierError(db_type) ! else: ! klass, supports_mode = _storage_types["dbm"] ! else: ! klass, supports_mode = _storage_types["pickle"] try: if supports_mode and mode is not None: --- 656,666 ---- the same given the same options. ! db_type must be one of the following strings: ! dbm, pickle, pgsql, mysql ! """ ! try: ! klass, supports_mode = _storage_types[db_type] ! except KeyError: ! raise NoSuchClassifierError(db_type) try: if supports_mode and mode is not None: *************** *** 683,686 **** --- 678,721 ---- sys.exit() + # The different database types that are available. + # The key should be the command-line switch that is used to select this + # type, and the value should be the name of the type (which + # must be a valid key for the _storage_types dictionary). + _storage_options = { "-p" : "pickle", + "-d" : "dbm", + } + + def database_type(opts): + """Return the name of the database and the type to use. The output of + this function can be used as the db_type parameter for the open_storage + function, for example: + + [standard getopts code] + db_name, db_type = database_types(opts) + storage = open_storage(db_name, db_type) + + The selection is made based on the options passed, or, if the + appropriate options are not present, the options in the global + options object. + + Currently supports: + -p : pickle + -d : dbm + """ + nm, typ = None, None + for opt, arg in opts: + if _storage_options.has_key(opt): + if nm is None and typ is None: + nm, typ = arg, _storage_options[opt] + else: + raise MutuallyExclusiveError() + if nm is None and typ is None: + typ = options["Storage", "persistent_use_database"] + if typ is True or typ == "True": + typ = "dbm" + elif typ is False or typ == "False": + typ = "pickle" + nm = get_pathname_option("Storage", "persistent_storage_file") + return nm, typ if __name__ == '__main__': From anadelonbrin at users.sourceforge.net Thu Feb 5 03:23:42 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Feb 5 03:26:07 2004 Subject: [Spambayes-checkins] spambayes/spambayes ProxyUI.py,1.40,1.41 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7589/spambayes Modified Files: ProxyUI.py Log Message: Richie hasn't managed to find time to test if this is causing a problem or not (and I'm not smart enough to ), but he suspects that it could be, and given that this doesn't really break or change anything much at all, that's good enough for me, and fixing it before the release sounds like a good idea. Basically, do the db save after each review page *before* writing anything to the browser, so that if the user has (naughty naughty) closed the browser already, it'll still do the save. If they close it before the first message is saved, it'll still try and write (the "training..." message), but that'd have to be very fast. Index: ProxyUI.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** ProxyUI.py 12 Jan 2004 22:27:39 -0000 1.40 --- ProxyUI.py 5 Feb 2004 08:23:40 -0000 1.41 *************** *** 398,403 **** if numTrained != 1: plural = 's' - self.write("Trained on %d message%s. " % (numTrained, plural)) self._doSave() self.write("
 ") --- 398,403 ---- if numTrained != 1: plural = 's' self._doSave() + self.write("Trained on %d message%s. " % (numTrained, plural)) self.write("
 ") From anadelonbrin at users.sourceforge.net Thu Feb 5 03:40:25 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Feb 5 03:42:50 2004 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py,1.125,1.126 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11203/Outlook2000 Modified Files: addin.py Log Message: If the special folders can't be found, then report this to the user. The idea here is to tell people what the problem is when they delete their spam/unsure folder, rather than just leave the mail unfiltered, and suggest how they could fix it. The change will be ok as long as nothing else triggers the "Error finding the MAPI folders for a folder switch event" error. Note that those with the spam/unsure folder *in* the deleted items folder are still on their own. Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.125 retrieving revision 1.126 diff -C2 -d -r1.125 -r1.126 *** addin.py 21 Jan 2004 19:40:51 -0000 1.125 --- addin.py 5 Feb 2004 08:40:22 -0000 1.126 *************** *** 1102,1105 **** --- 1102,1110 ---- except: print "Error finding the MAPI folders for a folder switch event" + self.manager.ReportError("You must configure the Possible Spam/Spam folder\n" \ + "(Maybe you deleted the folder, rather than " \ + "the items in it? If so, create a new folder " \ + "and use the Manager to select it)", + "Invalid Configuration") traceback.print_exc() if self.but_recover_as is not None: From anadelonbrin at users.sourceforge.net Thu Feb 5 04:03:19 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Feb 5 04:05:51 2004 Subject: [Spambayes-checkins] spambayes CHANGELOG.txt, 1.33, 1.34 WHAT_IS_NEW.txt, 1.26, 1.27 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16166 Modified Files: CHANGELOG.txt WHAT_IS_NEW.txt Log Message: Bring up to date. Index: CHANGELOG.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/CHANGELOG.txt,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** CHANGELOG.txt 29 Jan 2004 14:44:19 -0000 1.33 --- CHANGELOG.txt 5 Feb 2004 09:03:03 -0000 1.34 *************** *** 1,8 **** [Note that all dates are in English, not American format - i.e. day/month/year] ! Alpha Release 8 =============== Skip Montanaro 29/01/2004 sb_mboxtrain.py: preserve modtimes in Maildir & MH mailboxes Skip Montanaro 21/01/2004 added findbest.py to contrib/ Tony Meyer 13/01/2004 Fix [ 874784 ] Error in onReview code Skip Montanaro 13/01/2004 UserInterface: Split digest auth info properly. Simple split-on-comma fails if the uri contains commas. --- 1,21 ---- [Note that all dates are in English, not American format - i.e. day/month/year] ! Alpha Release 9 =============== + Tony Meyer 05/02/2004 Make all the scripts consistent in their command line setting of database type/name. -d is dbm, -p is pickle. Also setup things nicer for mysql and pgsql. + Tony Meyer 05/02/2004 If the allowed values for an option is a tuple of values, then the type is correct if the value is one of those types. + Tony Meyer 05/02/2004 Outlook: If the special folders can't be found, then report this to the user. + Tony Meyer 05/02/2004 ProxyUI: Do the save one line earlier, which might mean that if the user has closed the browser, a db error is avoided. + Tony Meyer 05/02/2004 imapfilter has been adding two mailid headers, so stop that. + Tony Meyer 05/02/2004 Fix [ 890645 ] imapfilter: "ValueError: year out of range" + Skip Montanaro 30/01/2004 Recognize "abbreviated" URLs of the form www.xyz.com or ftp.xyz.com as http://www.xyz.com and ftp://ftp.xyz.com, respectively. This gets rid of some fairly common "skip:w NNN" tokens. Enabled by the new tokenizer option, x-fancy_url_recognition. Skip Montanaro 29/01/2004 sb_mboxtrain.py: preserve modtimes in Maildir & MH mailboxes + Tony Meyer 27/01/2004 Fix [ 870799 ] imap trying to fetch invalid message UID + Tony Meyer 27/01/2004 Fix [ 881427 ] sb_mboxtrain.py requires -d or -D + Tony Meyer 27/01/2004 Add options to ImapUI that the ProxyUI has, and also belong there. + Kenny Pitt 22/01/2004 Outlook: Fix confusing error log message. Timer delay values are configured in seconds, not milliseconds. Skip Montanaro 21/01/2004 added findbest.py to contrib/ + Skip Montanaro 15/01/2004 loosecksum.py: allow multiple mailboxes on the command line, not just a single message on stdin or a file containing one message + Skip Montanaro 15/01/2004 Add -o option to allow users to set arbitrary global options from the command line to dbexpimp, imapfilter, mboxtrain, notesfilter, pop3dnd, server, upload, xmlrpcserver. Tony Meyer 13/01/2004 Fix [ 874784 ] Error in onReview code Skip Montanaro 13/01/2004 UserInterface: Split digest auth info properly. Simple split-on-comma fails if the uri contains commas. *************** *** 17,23 **** Tony Meyer 11/01/2004 mkgraph.py: Add a training_is_ham line to the error graph which shows the percentage of training data that is ham (i.e. shows the imbalance). Tony Meyer 11/01/2004 mkgraph.py: Modify the outputing so that it can be in different formats for those of us without plotmtv. The -c command line option outputs all the lines in the same set of rows, rather than in their own set as is the default. The -s arg specifies the separator for this sort of output (defaults to a comma, so that csv files are output). ! Tony Meyer 11/01/2003 incremental.py: Add a docstring and the ability to print it with -h or --help to incremental.py ! Tony Meyer 11/01/2003 regimes.py: Add a docstring that outlines the various regimes in hopefully easy to understand terms. Print this out if regimes.py is executed. ! Tony Meyer 11/01/2003 regimes.py: Add a new regime - balanced_corrected. Tony Meyer 08/01/2004 Fix [ 805852 ] need python-dev package on Debian Skip Montanaro 08/01/2004 table.py: space the table out a little more. --- 30,36 ---- Tony Meyer 11/01/2004 mkgraph.py: Add a training_is_ham line to the error graph which shows the percentage of training data that is ham (i.e. shows the imbalance). Tony Meyer 11/01/2004 mkgraph.py: Modify the outputing so that it can be in different formats for those of us without plotmtv. The -c command line option outputs all the lines in the same set of rows, rather than in their own set as is the default. The -s arg specifies the separator for this sort of output (defaults to a comma, so that csv files are output). ! Tony Meyer 11/01/2004 incremental.py: Add a docstring and the ability to print it with -h or --help to incremental.py ! Tony Meyer 11/01/2004 regimes.py: Add a docstring that outlines the various regimes in hopefully easy to understand terms. Print this out if regimes.py is executed. ! Tony Meyer 11/01/2004 regimes.py: Add a new regime - balanced_corrected. Tony Meyer 08/01/2004 Fix [ 805852 ] need python-dev package on Debian Skip Montanaro 08/01/2004 table.py: space the table out a little more. *************** *** 165,168 **** --- 178,185 ---- Tony Meyer 20/09/2003 Make the review messages page on the web UI more customizable. + Alpha Release 8 + =============== + There is no Alpha Release 8. + Alpha Release 7 =============== Index: WHAT_IS_NEW.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/WHAT_IS_NEW.txt,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** WHAT_IS_NEW.txt 5 Feb 2004 08:13:25 -0000 1.26 --- WHAT_IS_NEW.txt 5 Feb 2004 09:03:16 -0000 1.27 *************** *** 1,4 **** This file covers the major changes between each release. For more details, ! the reader is referred to the changelog (changelog.txt in the main directory of the archive), or for extreme details, to the check-ins archive (see ) --- 1,4 ---- This file covers the major changes between each release. For more details, ! the reader is referred to the changelog (CHANGELOG.TXT in the main directory of the archive), or for extreme details, to the check-ins archive (see ) *************** *** 8,12 **** Any actions necessary to move to this release from the previous release are ! noted in the "Transition" section. New in Alpha Release 9 --- 8,13 ---- Any actions necessary to move to this release from the previous release are ! noted in the "Transition" section. You should also read the "Incompatible ! changes" section. New in Alpha Release 9 *************** *** 55,59 **** "pgsql::") has been removed. These are now set like any other database type, using the persistent_use_database option (these cannot be set via ! the command line). There should be no other incompatible changes (from 1.0a7) in this release. --- 56,60 ---- "pgsql::") has been removed. These are now set like any other database type, using the persistent_use_database option (these cannot be set via ! the command line, apart from with the generic -o option). There should be no other incompatible changes (from 1.0a7) in this release. *************** *** 94,97 **** --- 95,102 ---- o Fix things so that the plug-in should better appear in the "COM Addins" list when running the binary version. + o Add a warning when the Spam/Unsure folder cannot be found, with a + suggestion about how this might have happened, and what to do about it. + o Fix log message that indicated that timer delay values are in milliseconds + (they are in seconds). POP3 Proxy / SMTP Proxy *************** *** 148,151 **** --- 153,158 ---- interface (but don't launch a browser). o Ignore errors that occur when parsing a message. + o Under certain circumstances, the fitler would add two identical + SpamBayes ID headers; this is no longer the case. sb_filter *************** *** 190,194 **** --- 197,205 ---- General ------- + o sb_mboxtrain.py now preserves modtimes in Maildir and MH mailboxes. + o loosecksum.py now allows multiple mailboxes on the command line. o Option names are always case insensitive, no matter what. + o All scripts can use a new "-o" option, to set artibrary global options + from the command line (instead of via a configuration file). o Non-absolute file/path options are relative to the last configuration file loaded, not the current working directory, as previously. *************** *** 212,215 **** --- 223,228 ---- o New script: hammer.py: Hammers the core SpamBayes code, repeatedly training and classifying using faked-up messages. + o New script: findbest.py, to find the next 'best' unsure message to train + on. o Previous releases have included the sb_pop3dnd.py script (once named sb_overkill.py). With this release, this script should be fully *************** *** 240,244 **** The following bugs tracked via the Sourceforge system were fixed: 818871, 833439, 803798, 787676, 860410, 856628, 859215, 856141, 842984, ! 872044, 805852, 874784 A URL containing the details of these bugs can be made by appending the --- 253,257 ---- The following bugs tracked via the Sourceforge system were fixed: 818871, 833439, 803798, 787676, 860410, 856628, 859215, 856141, 842984, ! 872044, 805852, 874784, 824628, 890645, 870799, 881427 A URL containing the details of these bugs can be made by appending the *************** *** 261,265 **** The following patches tracked via the Sourceforge system were integrated for this release. ! 842464, 831388, 809008, 831388 A url containing the details of these feature requests can be made by --- 274,278 ---- The following patches tracked via the Sourceforge system were integrated for this release. ! 842464, 831388, 809008, 831388, 857595, 857597, 861656 A url containing the details of these feature requests can be made by *************** *** 347,348 **** --- 360,366 ---- o [Tokenizer] x-pick_apart_urls Pick out some semantic bits from URLs. + + o [Tokenizer] x-fancy_url_recognition + Recognize 'abbreviated' URLs of the form www.xyz.com or ftp.xyz.com as + http://www.xyz.com and ftp://ftp.xyz.com, respectively. This gets rid + of some fairly common "skip:w NNN" tokens. From anadelonbrin at users.sourceforge.net Thu Feb 5 04:33:05 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Feb 5 04:35:31 2004 Subject: [Spambayes-checkins] spambayes/spambayes OptionsClass.py, 1.22, 1.23 ProxyUI.py, 1.41, 1.42 UserInterface.py, 1.41, 1.42 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22836/spambayes Modified Files: OptionsClass.py ProxyUI.py UserInterface.py Log Message: For any regex defined options, allow a blank string (i.e. no answer) to be a valid response. I'm sure this was already the case, but it doesn't seem so. Add a third configuration page. This will automatically include all current experimental (but not deprecated, as long as we all stuck to putting (DEPRECATED) at the start of the description) options. Maybe people will test things for us. The link to this is on the main configuration page; maybe it should be on the advanced page? Index: OptionsClass.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/OptionsClass.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** OptionsClass.py 5 Feb 2004 08:13:27 -0000 1.22 --- OptionsClass.py 5 Feb 2004 09:33:02 -0000 1.23 *************** *** 185,188 **** --- 185,191 ---- # (So pass 1. instead of 1, for example) return False + if value == "": + # A blank string is always ok. + return True avals = self._split_values(value) # in this case, allowed_values must be a regex, and Index: ProxyUI.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/ProxyUI.py,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** ProxyUI.py 5 Feb 2004 08:23:40 -0000 1.41 --- ProxyUI.py 5 Feb 2004 09:33:02 -0000 1.42 *************** *** 128,132 **** ('Tokenizer', 'summarize_email_prefixes'), ('Tokenizer', 'summarize_email_suffixes'), - ('Tokenizer', 'x-pick_apart_urls'), ('Training Options', None), ('Hammie', 'train_on_filter'), --- 128,131 ---- *************** *** 719,723 **** errmsg = UserInterface.UserInterface.verifyInput(self, parms, pmap) ! if pmap == adv_map: return errmsg --- 718,722 ---- errmsg = UserInterface.UserInterface.verifyInput(self, parms, pmap) ! if pmap != parm_ini_map: return errmsg Index: UserInterface.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/UserInterface.py,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** UserInterface.py 2 Jan 2004 00:20:56 -0000 1.41 --- UserInterface.py 5 Feb 2004 09:33:02 -0000 1.42 *************** *** 22,25 **** --- 22,26 ---- onConfig - present the appropriate configuration page onAdvancedconfig - present the appropriate advanced configuration page + onExperimentalconfig - present the experimental options configuration page onHelp - present the help page onStats - present statistics information *************** *** 93,96 **** --- 94,110 ---- 'message', 'train', 'classify', 'query') + experimental_ini_map = ( + ('Experimental Options', None), + ) + + # Dynamically add any current experimental options. + # (Don't add deprecated options, or, more specifically, any + # options whose description starts with (DEPRECATED)). + for opt in options.options(True): + sect, opt = opt[1:].split(']', 1) + if opt[:2].lower() == "x-" and \ + not options.doc(sect, opt).lower().startswith("(deprecated)"): + experimental_ini_map += ((sect, opt),) + class UserInterfaceServer(Dibbler.HTTPServer): """Implements the web server component via a Dibbler plugin.""" *************** *** 586,589 **** --- 600,615 ---- pass + def onExperimentalconfig(self): + html = self._buildConfigPage(experimental_ini_map) + html.title = 'Home > Experimental Configuration' + html.pagename = '> Experimental Configuration' + html.adv_button.name.value = "Back to basic configuration" + html.adv_button.action = "config" + html.config_submit.value = "Save experimental options" + html.restore.value = "Restore experimental options defaults (all off)" + del html.exp_button + self.writeOKHeaders('text/html') + self.write(html) + def onAdvancedconfig(self): html = self._buildConfigPage(self.advanced_options_map) *************** *** 594,597 **** --- 620,624 ---- html.config_submit.value = "Save advanced options" html.restore.value = "Restore advanced options defaults" + del html.exp_button self.writeOKHeaders('text/html') self.write(html) *************** *** 735,738 **** --- 762,767 ---- if parms["how"] == "Save advanced options": pmap = self.advanced_options_map + elif parms["how"] == "Save experimental options": + pmap = experimental_ini_map del parms["how"] html = self._getHTMLClone() From anadelonbrin at users.sourceforge.net Thu Feb 5 04:33:20 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Feb 5 04:35:45 2004 Subject: [Spambayes-checkins] spambayes/spambayes/resources ui.html, 1.30, 1.31 ui_html.py, 1.29, 1.30 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22836/spambayes/resources Modified Files: ui.html ui_html.py Log Message: For any regex defined options, allow a blank string (i.e. no answer) to be a valid response. I'm sure this was already the case, but it doesn't seem so. Add a third configuration page. This will automatically include all current experimental (but not deprecated, as long as we all stuck to putting (DEPRECATED) at the start of the description) options. Maybe people will test things for us. The link to this is on the main configuration page; maybe it should be on the advanced page? Index: ui.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/resources/ui.html,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ui.html 31 Dec 2003 14:27:34 -0000 1.30 --- ui.html 5 Feb 2004 09:33:03 -0000 1.31 *************** *** 578,581 **** --- 578,587 ---- + +
+
+ +
+
Index: ui_html.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/resources/ui_html.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ui_html.py 31 Dec 2003 14:27:34 -0000 1.29 --- ui_html.py 5 Feb 2004 09:33:03 -0000 1.30 *************** *** 6,121 **** import zlib ! data = zlib.decompress("x\ ! !;WuJG7\032@\003h\000\027~kv=}7W\015\006?^\015\006ԋpĦy\ ! ʸE\032$\037],UB<𷈋8ʛdj\026ld?I7iy\020\0015>+^\ ! \004lY\024YVU\020.B\001KE/T\006_?dqΥc,\031 eo\032pL\ ! Ma{W\000#\027IlUʢ \007J\026\"7bC$Da9@\030oOXAr:\ ! -yrϋ8\014*\027q:fC?+\0310~x.\025\001`\035<\017E\"1\020Bz\031c\ ! ?\036my\0240Aջó|\025,<^,\001ǙH\"jq\0375j\002Aς4AfAx\ ! EF0R809˂(3{K\034`\0313G<\025\"W\003\002\022n&BZM\011\ ! o[Bp?9;=}R#\031Xq)\005WU C\033򇊄\\\001Q_C!3\012G\027?}=\ ! :%'nG\0306y8\003><@^Θ:uϼFK\036\036@\016\007=0 \035ӒuJd\ ! ղ[`uJv@t\032\002t\024y[\0111nX`\004dBwb`l@\ ! N$&\013!/I 奯4ȟ72\003\013=6A&\027jd\036^I\021}\006\006k^L\ ! (J?|dv\016x\000\0324=\0053P},\027Q\031\026?\004\\\003ON@a*V\034c˜a \ ! ' \036\016t-\\\024笌Q\000\024Gs\010b\025RgOSiV|XMޠG@a\ ! ZΪ\011&e,\036\010\\Rrch.\033hͪ$K\021ìJ`\026yZ\005\022qzTJ2`!g-\ ! \\\006l0\026<\000WK\014Л\000߀́\\C؁P%\023\031Oz\026x\013\010\ ! ֱ zzt H\000Bv\012\025ϟ\"Cd9\025\004֯fLˤ8~;Ż\004avb\020O\016'O\ ! ЀFj\031\013\036y$\031\024$\015@Zˇ\033AU\033uD\031ZnEaq͒;/Z\0308\017\ ! \016f\002P\002YB#]\001\0224\\\015o\011~eA\025y.VLyP=\025Z`[_Q{\011B;\022&\001\034@\ ! 8\030XUx\0158d{,D>\010O.9/Ya h;\003r^\020k0D**AL2\ ! \015&JEPr\015r\0024Xm6\007r4/y\002\022(+ZW+fA\013\001xĆqiɥ\035\001=\011\ ! M/^uupr03Ҥ<}U޿B$3ĠǯlVO.\0115\037=8\002\ ! .\024\015\027\021h\021iAc\020+\030G \020(\001\037O_\005 \000zzJ4|n\"(JMl\ ! 2/]\033q\020OV\023\015\0244|\032^N\017pd\016A\013\011Yt\\8R =\025\034P~\011\001@P\025Lj\ ! O\003\\o툮\036ZNW\021M@p/`,\021\0113Hߘ 3\017ʊY;|{-\001\ ! !AFȮ\015t/vF\015̗^mNJ+_\023֓JXOO\016\027V\004Vݢz#|\ ! sB~\035Qnx\030PMp\037\011q~.7\004bN\035ǰĀ\0125+\0279G\017i\037yo\014\ ! \\;\033\026p@G\001\030*nZjz\030`)\001\035C\011\023t\021T\010\025|\020Vc w6LyY\ ! )\007^BQA\014v\000Y\011e?WQΊfn \007[}\034p\035\022\0118\034\033Q/X\000`S~+DVH\ ! m\006\034\026e\016?Eֆ\015c>@\023_e+8\010$8R\036\027>]/q\015F3e:F3\020U\006\035&\021\003M.03]\012\002K\014F=8O'\0024\022b\036?J\ ! \012P\002\\s;\0250\001\033\000;X\035WB*dgI\010K\036Oq\004g4\012\006[\017BH\022Yg\ ! 'X\012fVJ#^0\0118wF=\030=9~\005hQױJ`i\006OҴ$\035*\ ! h\005^\005\020m_n$\005\003=pWj\016m\0300\002]zJ\007\005X\012\ ! 멫M\027_zb\033wk{KI@1A\005\017TE&ZYQ\036ߙ\020J1n.\024Xa\003\ ! \\M\020&:\035`\010z+\\CO`22\0048åܫPkY\030vQ\ ! `%O0\011B0)xvnBdz0eM~ߋz_\011\015?~\021Z^>\ ! z54\031\021\024E;<ǪӖ\026\006jJ0@1w'\034uy\0116cɜ\ ! R\021VNcM4o3J-ayKӨh°*PU=4\012nJʭ~4\031R7d|\ ! 5\031Ւ\0029w$t8\023wii|\024qR\020\006l\007\031\030Fbh^\0246,\ ! 鄉ZYg\015<$G\011(\012LĿ\025\0138}=ΆҀ`}n\011(ʑ\003\010\ ! \007bmñ\026j\036\"z\024C\027.J\030\02694^j\001̛.*iSd凈S\ ! 1\031Uw\0252f\036a{熞m[|ؼO'ɯ??e\000UR$aM\032߃$o(M\ ! FPI.\006q\035$'T\001)}Pt\031\003ߘ*1c^;K\"Eq;\037P\ ! \033WlM\\\032\035\003GP޿T\020\015W\"H\016\033J[jK%an\\,=61\032j\015NЎ\030̱\ ! WB\0347o[\025Då7Ҵq\037L\016M(B\003\020yؕ5\007X\017:^\001)s\022ݷX\ ! \0364k:+d\000xa7z\010H!+o\010\027M?V.\011:\032&qZ&Ϭ\033>&_y\ ! ̜]fN}\020\024b:SQu~V&̎!*!\"TM|J/\\\034g\020keELao\020K\ ! V\002;I\0060\030\026cFKU3餠\032̀\010\027\010e\005BZͣB̟|_۞2\0368\ ! 6YpN&\024ֽW\032\020W&\\\016m}Lb\004)-U\022+,}Ʈ!ٗ_~\005\ ! \004ۓKvrTuEҲF_F14\034]P7=\000<oO̒J\034\001\010%\ ! 3ݧ\027OQ&ڞKv\027/>Dn11cK~!ފ5ϯ`}{ztnd\ ! ULy;hWs/`>4\011ˁ7SҌ8}T[e}iv5M93\ ! RpLҥ\026\004\016\016ʬ\006\015t\037ʝP7׭V0zN't@i\ ! \002hh\020E\031\015҈\001]&\020F\032?i\027\\/\0154\017'ꃾѳ\022Lb٩l\031\ ! [\004{\021\034WG3R^\014\001oW\034|\0344\010\026^}\002$\010\016~\002\024\010\014^tl6\ ! ʢ1@H\014n \031/*'\024\017b]U7S\000݅\015\033fE-\005˩M禓\030\ ! n\017q9\010$\026=[XO1!]:PrŚ|\036];H\034\015\022h[G\ ! M\032\031m\023a*|e\010`\037b4M\026\030\0071\033\015pxFߌѨE+\ ! ToU\002\034L C\033[='u\035nJjf9_{:+f\017,\035\035\\<\ ! \033գ\012e\0157|\031\007VfC0<{\033a\000yp]\011&:\033\ ! K1ud+\017r[36{A\032YnGF:qh!\026\"6~}\021=\030SuJ\ ! &>h1eHa7y\024;\007Ups\011HĔv!&'%0-\027]VSO\030'\ ! ڴkRL:3ڔ?]4Q\015?4\013Lz4\004~\013e\037\003~4ࣿ\ ! \024\006l#Kq홢\004\033\0265;N/\033z0Qv0\0266\003]\020\025ӏaV:\020\014#Kh\ ! XL\035H2Ugnj`7I5\017h[`]C! }W/q}wȮ\016w\033\037T8\031fol\ ! X\015\017r:\027G㳽&^\013c\016đהǮͫv\003\021]+vvd|\ ! \030MIzA\004H\024٭f(TTq&a\010\031\035\037P\033і-խY˼\035#mVQb\036\ ! oN]\0366\007Hx6Hwj'\015_msԿ\027k\016txo\032{_߾6F\022\030V4\ ! -vùQ\011BQb\005tK\001V\005j\035\002:{|\013t\000(NbO5ـ.T\0079 \007S &l\ ! \"'Tɰl\031S#$|\030ָ i@B\034u+\\E\010\036D\010\036 Y\"]L~\0267\035\ ! \0103jv\031C\025~\007ж)k%Tۋڶ\002\011&C\015S:\004UgR\035ٺ=f\025\021\023g\ ! 2#\037\0358Rea73t(ݫ*CDM4t6*U\0330΍^tl4e\ ! Z\017Yc<ǣq\007i\006͚g\006\020͗))ѦEҿ\011wgc\0349\ ! v.\022\015wRN\004\035\026b\012˭*FW7\022wt͜eQa:K%FՊ\001\ ! mH}\034>\013')5G)\007+\025\023\030\0063=۽\017kq\017*I?R[~\ ! ;,e\021uڵ)\016\0365ZRB?\020lS}S\017\036jC\010<@NΘ:uϼFK\036\036@\016\007=0 \035ӒuJ\ ! dղ[`uJ@t\032m\003t\024y[\0111O7,k0z]s2|vnMϻv10b\ ! m'\\\022\023xGϐ\027Q|$W\032\033\036`\033yx9g2\017/}?g>\0035O/`\ ! *q\024%\037L2;\007<\000B\015\036H͂\031>X\014\037ȩ'#0\025KSEg0\020\ ! k}1\010\003]Ki/9+>.;u70Q\034X\006qz\024zZ\025/\026gh0g\ ! j\002d\021K6\0230\027bAwG,8\005&\024\013\022!zA\032f'\012ћ\022\0279\037*A\000W\026TAbd\007\005سX\005e\032 #k\022\001\ ! \024៮U\000ZCּB\023\016H\025\030\006; W\015\006#K$\034\"\"\030Ĕ*s\ ! `RZ\004% 'pIfx M'`-ub\026\020\007Nl\030睖\\\021\023)ˌ\ ! :|ޘ\025ZW\007'\017ӯ=#M^,I\002=C\014zf\025\002P\003\016zڃC_'\ ! BЌ\014\021\026\001\026D?\006Aq}\010\012!\033U\000\002\027\017L\003W,\035φ\ ! >,cҵ9\035\027\017tn5@AW \014\027I0\036ཐE%#\005S\0010\034p\0174\011UȤ\ ! Ī>֎\001\032;t\025\004\004\002\022X\0370\0112\023\010PV4i惦߻Sn\014\ ! \010\0112LFvoӥv\001\027\03253_{\015O7\011\037+8~MXON*a==_X\021Za\ ! \021\013u(GAf2ad|PKr\012yNӈ*(P!\014*\01720tĬ2\020)*-m0Y\ ! \000\011\023T9:}g\033yH\036\011,\012LĿ\023s8}=ΆҀ`}a\011(ʑ=\010\ ! \007bm±\026j\036\"z\024B\0276J\030\02694Nj\001̛.*iSd凈\023\ ! 1\031Uw\0252f\036a{熞m[|XO'ɯ\017?~8e\000UR$a\033?$o(\ ! :Mr1 =\016H黅\023̰,\035`|V\031\022D\004Y<\024)$\027V:\011w:\ ! ހbko\030=kB\024AhVRC_*\011g1:GK\014H\032\0032\\\030w\ ! nZ\023E\032n%=l\0229A~hFbĊ\015J\020Qc\014ļ\016edPkv`%\ ! \022ƾy}+ܪ \032.\013`r@F\0377\016c\013\015@f|[\037`Q?T{\005Ita\ ! yӬcuV\000npu\037*?aCV\020.=/~p\\\022t5pM㊿LY7}L\032\ ! 9̜ (ĺUd\036L\035CTCD\036R_8N7!hךˊW߸!t\ ! \006I\004Bw*6\015`1,ƌ(fIA5B9\002\021.\020[\012i'G?Hm{x\ ! ld;EPdZ^j@\\&VpK:1\021Ti\026K.T\031ZPeF\014\011/O\ ! \000^`&El]\005͟ d\037\023b\005|s\037\004E3FuE9)\026m&t#\\\010h\ ! :e\030\021\0330\016.o\024\002fʿ\000fHT{Dg]\014ٺq\006A\016 q\001\ ! 6kx6h\016tMù0n\036\010߿8uE\034E\034XNNOy\012#1!\002 \005\ ! RUgwi\016՜8sߙj0~]\015\003\032\014\025͖UP?\032\017/QJ\026\005KGD\000ıS\ ! Vs&9\007\013m$]\030|͞<\036r}?%xZi\035Z*\024qf°e>PO\ ! `p/W_N^k\017TH;T\\5+W3v\020c\037/YI?\034\ ! %;9^\"ie/ǿ\030\032\016Y.\036\000\036χ濷JfIL%\000\004{\022\ ! Ӌ\003\037v\"\"\005\017k[L̘zr_wb+X\016\016\017۽\016\ ! *i\030?/y\007\015?rn3\030k\017M²5\0377#Nߤ9UxVYkl]xSNja\ ! \024(tE0dx0b\0372v\003d;]c\007rgerB=,V,\027\027};C\"\0208bgd8\027\035OZy\014F\012\013\031i)\035Oe\ ! 7,c#D\010I}[\032ṉ\015= d\035-!UISw\033f3\012rʝ2KD\ ! \0203\000\021γ/q&~5Oqe\0241\0266\021V((\0022Zf-0\026v\005#\ ! \010*>h.[$\032\021\033~kN3\033?T)Z JäJ*\037RZh֩MJ5\022\ ! -yj?Ug>p6\027U[]BAWu@oU6#]oVinWm\005HM\ ! \011\036`TO<\034\017ߔ8w*\035142\014mlu)|)鬘=tws%\ ! KU*ؗ6fg\037ˏ[\026\015n\002\004\031Nu%N~Wn0\032\ ! [/]H\002֑->aNnE,Vԋ\0065jd-\036\031@ơXtNG`LՅ+\ ! F\000Ŕ!Q\034m%X\"ٯ\022SuV<\002~\004SxWxô\\t\033M=bD\ ! 7jӮI1MhSxZhF5d?Ҝ\0262F\032\020ϱƖys\017ɤ‚\ ! R\030HS;,ŵgn\022lXH;\014o\021DZx\016\014C,L?Y@0:,\ ! ÚeD:sV\033\007Iy@\002\0326\006\001zk;\015}vE|kl7{\ ! 5:\035 sq=>i0FpJ\034yMk}\011߾nǨ[\020h~2m*lO6\ ! ݔ\027$NODj&(BE\025Wo\"@~ѱ\036\021m)ۀZݚ^>f5\031\024[\ ! x;u269PuvF³GW;ij[3N÷{81J?x\0101\ ! l\033΍J |\027\022+ȏON7\024`U\026!-,/6\000@\007$.T\015Bu\000ݞ\003Bz<\005\"hB\ ! &xB\033\017_}͆\001;>5B‡\021o[N\011\"\012$t΁\\UA\001E.gy}ӑ\ ! \013ɳV2ǀ\023S'\002~2\014g u$hrlw[\0200flwn\025^_\011>}\026\ ! AQJS:&lhlfv7\0329;TU3n\014u\030dG\004NWf4/\033.t)L+(e\003{B-\\Gt|J\031\000\015D%|\010Te,=(H[\000\032'¥BEcڨ3\ ! \002*\006\031?Lt-\020\024\036\006G5ge\007\037\017QW8mJt\034|t{\ ! \013z\\sc&t{[)a\035w|}\0218\017sR/tk' _ނx\014\ ! `\012%`jgsQF\000\0350\004sȱAT6>\023HP{&݁/\\~윭cjS\0371q\ ! &\023~=4Qj\022,;&xu&n\021{U%(&Tj\003߹\024p.l\ ! 9S!1kLUxx9 ̀Y3\001D2}\012.a9>\026s79ڴH7lC3\ ! GV:D\002nU`\020ULA{Q&[55POp8cb\ ! @kk+R\"\002qIJnQJ\005epϽ*?avZ)s}O#>\013T&\ ! C]ߍG\020N:(؈D*UfB\026٫UG-v y|j\024d \ ! \0372Ǹ\025$\021VO@3'#X_^.\"\022kGEjPu\0319{!Ш\036=\015\014\ ! \020x\"nHЅv͊1\034>몼ot~\\R7ub\030WvT`̯g\ ! \033??\034G}\030^\027\020\004I\024(dCv|6\032NO4D#o\027VU&\015\003\007\021o\ ! _b`N#hx=\032OY㫩Hh]\"T7qe \\/]zJ\ ! ^̌ق\022N\007) Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24395/spambayes Modified Files: UserInterface.py Log Message: Opps. Restoring the defaults on the experimental config page would have restore the main configuration options. Fix that. Index: UserInterface.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/UserInterface.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** UserInterface.py 5 Feb 2004 09:33:02 -0000 1.42 --- UserInterface.py 5 Feb 2004 09:40:30 -0000 1.43 *************** *** 804,807 **** --- 804,809 ---- if how == "Restore advanced options defaults": self.restoreConfigDefaults(self.advanced_options_map) + elif how == "Restore experimental options defaults (all off)": + self.restoreConfigDefaults(experimental_ini_map) else: self.restoreConfigDefaults(self.parm_ini_map) From anadelonbrin at users.sourceforge.net Thu Feb 5 04:41:51 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Feb 5 04:44:16 2004 Subject: [Spambayes-checkins] spambayes CHANGELOG.txt, 1.34, 1.35 WHAT_IS_NEW.txt, 1.27, 1.28 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24663 Modified Files: CHANGELOG.txt WHAT_IS_NEW.txt Log Message: Bring up to date. Index: CHANGELOG.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/CHANGELOG.txt,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** CHANGELOG.txt 5 Feb 2004 09:03:03 -0000 1.34 --- CHANGELOG.txt 5 Feb 2004 09:41:49 -0000 1.35 *************** *** 3,6 **** --- 3,7 ---- Alpha Release 9 =============== + Tony Meyer 05/02/2004 Web interface: added a third configuration page, which dynamically has all the experimental options (not the deprecated ones). Tony Meyer 05/02/2004 Make all the scripts consistent in their command line setting of database type/name. -d is dbm, -p is pickle. Also setup things nicer for mysql and pgsql. Tony Meyer 05/02/2004 If the allowed values for an option is a tuple of values, then the type is correct if the value is one of those types. Index: WHAT_IS_NEW.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/WHAT_IS_NEW.txt,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** WHAT_IS_NEW.txt 5 Feb 2004 09:03:16 -0000 1.27 --- WHAT_IS_NEW.txt 5 Feb 2004 09:41:49 -0000 1.28 *************** *** 136,139 **** --- 136,144 ---- the stats, and vice versa. o Quote IMAP folder names when displaying them. + o Added a third configuration page (via the "Experimental Configuration" + button on the main Configuration page). This shows all the current + experimental options (see the "New Experimental Options" section below). + Note that these are, as the name implies, experimental, and they might + not improve the results that you get. POP3 Proxy Service / POP3 Proxy Tray Application From kpitt at users.sourceforge.net Fri Feb 6 11:01:50 2004 From: kpitt at users.sourceforge.net (Kenny Pitt) Date: Fri Feb 6 11:04:29 2004 Subject: [Spambayes-checkins] spambayes/spambayes Version.py,1.27,1.28 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4816 Modified Files: Version.py Log Message: Drop separate InterfaceVersion numbers. Update versions in preparation for next release. Version numbers haven't been touched since 1.0a6, so increment any version for which changes have been checked in since the 2003-09-18 release date of 1.0a6 (which, it turns out, is all of them). Synchronize the Version and BinaryVersion numbers for sb_server. Index: Version.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Version.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Version.py 4 Feb 2004 15:49:59 -0000 1.27 --- Version.py 6 Feb 2004 16:01:46 -0000 1.28 *************** *** 22,42 **** versions = { # Non app specific - changed when "spambayes\*" changes significantly ! "Version": 0.2, "Description": "SpamBayes Engine", ! "Date": "July 2003", "Full Description": "%(Description)s Version %(Version)s (%(Date)s)", # Sub-dict for application specific version strings. "Apps": { "sb_filter" : { ! "Version": 0.1, "Description": "SpamBayes Command Line Filter", ! "Date": "January 2003", "Full Description": "%(Description)s Version %(Version)s (%(Date)s)", }, "Outlook" : { ! "Version": 0.85, ! "BinaryVersion": 0.85, "Description": "SpamBayes Outlook Addin", ! "Date": "December 2003", "Full Description": "%(Description)s Version %(Version)s (%(Date)s)", "Full Description Binary": --- 22,42 ---- versions = { # Non app specific - changed when "spambayes\*" changes significantly ! "Version": 0.3, "Description": "SpamBayes Engine", ! "Date": "January 2004", "Full Description": "%(Description)s Version %(Version)s (%(Date)s)", # Sub-dict for application specific version strings. "Apps": { "sb_filter" : { ! "Version": 0.2, "Description": "SpamBayes Command Line Filter", ! "Date": "February 2004", "Full Description": "%(Description)s Version %(Version)s (%(Date)s)", }, "Outlook" : { ! "Version": 0.9, ! "BinaryVersion": 0.9, "Description": "SpamBayes Outlook Addin", ! "Date": "February 2004", "Full Description": "%(Description)s Version %(Version)s (%(Date)s)", "Full Description Binary": *************** *** 48,62 **** }, "POP3 Proxy" : { ! "Version": 0.3, ! "BinaryVersion": 0.2, "Description": "SpamBayes POP3 Proxy", ! "Date": "December 2003", ! "InterfaceVersion": 0.03, ! "InterfaceDescription": "POP3 Proxy Web Interface", ! "Full Description": """%(Description)s Version %(Version)s (%(Date)s), ! using %(InterfaceDescription)s Version %(InterfaceVersion)s""", "Full Description Binary": ! """%(Description)s Binary Version %(BinaryVersion)s (%(Date)s), ! using %(InterfaceDescription)s Version %(InterfaceVersion)s""", # Note this means we can change the download page later, and old # versions will still go to the new page. --- 48,58 ---- }, "POP3 Proxy" : { ! "Version": 0.4, ! "BinaryVersion": 0.4, "Description": "SpamBayes POP3 Proxy", ! "Date": "February 2004", ! "Full Description": """%(Description)s Version %(Version)s (%(Date)s)""", "Full Description Binary": ! """%(Description)s Binary Version %(BinaryVersion)s (%(Date)s)""", # Note this means we can change the download page later, and old # versions will still go to the new page. *************** *** 65,90 **** }, "Lotus Notes Filter" : { ! "Version": 0.01, "Description": "SpamBayes Lotus Notes Filter", ! "Date": "March 2003", "Full Description": "%(Description)s Version %(Version)s (%(Date)s)", }, "IMAP Filter" : { ! "Version": 0.1, "Description": "SpamBayes IMAP Filter", ! "Date": "September 2003", ! "InterfaceVersion": 0.02, ! "InterfaceDescription": "IMAP Filter Web Interface", ! "Full Description": """%(Description)s Version %(Version)s (%(Date)s), ! using %(InterfaceDescription)s Version %(InterfaceVersion)s""", }, "IMAP Server" : { ! "Version": 0.01, "Description": "SpamBayes IMAP Server", ! "Date": "September 2003", ! "InterfaceVersion": 0.02, ! "InterfaceDescription": "IMAP Server Web Interface", ! "Full Description": """%(Description)s Version %(Version)s (%(Date)s), ! using %(InterfaceDescription)s Version %(InterfaceVersion)s""", }, }, --- 61,80 ---- }, "Lotus Notes Filter" : { ! "Version": 0.02, "Description": "SpamBayes Lotus Notes Filter", ! "Date": "February 2004", "Full Description": "%(Description)s Version %(Version)s (%(Date)s)", }, "IMAP Filter" : { ! "Version": 0.2, "Description": "SpamBayes IMAP Filter", ! "Date": "February 2004", ! "Full Description": """%(Description)s Version %(Version)s (%(Date)s)""", }, "IMAP Server" : { ! "Version": 0.02, "Description": "SpamBayes IMAP Server", ! "Date": "January 2004", ! "Full Description": """%(Description)s Version %(Version)s (%(Date)s)""", }, }, From montanaro at users.sourceforge.net Fri Feb 6 16:43:02 2004 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Fri Feb 6 16:45:43 2004 Subject: [Spambayes-checkins] spambayes/spambayes classifier.py,1.22,1.23 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18472 Modified Files: classifier.py Log Message: let's get the 2.2 compatibility enumerate() function right... Index: classifier.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/classifier.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** classifier.py 2 Feb 2004 13:29:42 -0000 1.22 --- classifier.py 6 Feb 2004 21:43:00 -0000 1.23 *************** *** 61,65 **** except NameError: def enumerate(seq): ! return zip(range(len(seq)), seq) DOMAIN_AND_PORT_RE = re.compile(r"([^:/\\]+)(:([\d]+))?") --- 61,68 ---- except NameError: def enumerate(seq): ! i = 0 ! for elt in seq: ! yield (i, elt) ! i += 1 DOMAIN_AND_PORT_RE = re.compile(r"([^:/\\]+)(:([\d]+))?") From montanaro at users.sourceforge.net Fri Feb 6 16:58:18 2004 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Fri Feb 6 17:01:00 2004 Subject: [Spambayes-checkins] spambayes/contrib tte.py,NONE,1.1 Message-ID: Update of /cvsroot/spambayes/spambayes/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21477 Added Files: tte.py Log Message: Just messin' around... Train to exhaustion based upon my understanding of the technique as described in Gary Robinson's blog. --- NEW FILE: tte.py --- #!/usr/bin/env python """ Train to exhaustion: train repeatedly on a pile of ham and spam until everything scores properly. usage %(prog)s [ -h ] -g file -s file [ -d file | -p file ] [ -m N ] -h - print this documentation and exit. -g file - take ham from file -s file - take spam from file -d file - use a database-based classifier named file -p file - use a pickle-based classifier named file -m N - train on at most N messages (nham == N/2 and nspam == N/2) See Gary Robinson's blog: http://www.garyrobinson.net/2004/02/spam_filtering_.html """ import sys import getopt import os from spambayes import storage from spambayes import Options from spambayes import mboxutils from spambayes.tokenizer import tokenize prog = os.path.basename(sys.argv[0]) def usage(msg=None): if msg is not None: print >> sys.stderr, msg print >> sys.stderr, __doc__.strip() % globals() def train(store, ham, spam, maxmsgs): smisses = hmisses = round = 0 ham_cutoff = Options.options["Categorization", "ham_cutoff"] spam_cutoff = Options.options["Categorization", "spam_cutoff"] while hmisses or smisses or round == 0: hambone = mboxutils.getmbox(ham) spamcan = mboxutils.getmbox(spam) round += 1 hmisses = smisses = nmsgs = 0 try: while not maxmsgs or nmsgs < maxmsgs: hammsg = hambone.next() spammsg = spamcan.next() nmsgs += 2 sys.stdout.write("\r%5d" % nmsgs) sys.stdout.flush() if store.spamprob(tokenize(hammsg)) > ham_cutoff: hmisses += 1 store.learn(tokenize(hammsg), False) if store.spamprob(tokenize(spammsg)) < spam_cutoff: smisses += 1 store.learn(tokenize(spammsg), True) except StopIteration: pass print "\rround: %2d, msgs: %4d, ham misses: %3d, spam misses: %3d" % \ (round, nmsgs, hmisses, smisses) def main(args): try: opts, args = getopt.getopt(args, "hg:s:d:p:o:m:", ["help", "good=", "spam=", "database=", "pickle=", "option=", "max="]) except getopt.GetoptError, msg: usage(msg) return 1 ham = spam = dbname = usedb = None maxmsgs = 0 for opt, arg in opts: if opt in ("-h", "--help"): usage() return 0 elif opt in ("-g", "--good"): ham = arg elif opt in ("-s", "--spam"): spam = arg elif opt in ("-m", "--max"): maxmsgs = int(arg) elif opt in ('-o', '--option'): Options.options.set_from_cmdline(arg, sys.stderr) if ham is None or spam is None: usage("require both ham and spam piles") return 1 dbname, usedb = storage.database_type(opts) try: os.unlink(dbname) except OSError: pass store = storage.open_storage(dbname, usedb) train(store, ham, spam, maxmsgs) store.store() return 0 if __name__ == "__main__": sys.exit(main(sys.argv[1:])) From kpitt at users.sourceforge.net Fri Feb 6 17:44:56 2004 From: kpitt at users.sourceforge.net (Kenny Pitt) Date: Fri Feb 6 17:47:37 2004 Subject: [Spambayes-checkins] website faq.txt,1.58,1.59 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32124 Modified Files: faq.txt Log Message: Add info about accessing Yahoo! Mail under Compatibility section. Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** faq.txt 21 Jan 2004 02:25:58 -0000 1.58 --- faq.txt 6 Feb 2004 22:44:53 -0000 1.59 *************** *** 431,434 **** --- 431,452 ---- + Will SpamBayes work with Yahoo! Mail? + ------------------------------------- + + If you subscribe to Yahoo! Mail Plus, you have the option of accessing your + Yahoo! mail via the POP3 protocol. SpamBayes has a POP3 proxy application + called `sb_server`_ that will allow you to filter any POP3 mail account using + a POP3 client of your choice (Outlook, Outlook Express, Netscape, Mozilla, + Eudora, etc.). + + If you use the free Yahoo! Mail service, then Yahoo no longer provides POP3 + access. However, there is an open-source program called YahooPOPs! that + can be used to provide a POP3 interface to the free Yahoo! Mail service. + See the `YahooPOPs! home page`_ for more information. + + .. _`sb_server`: http://spambayes.sourceforge.net/applications.html#sb_server + .. _`YahooPOPs! home page`: http://yahoopops.sourceforge.net + + Outlook Plugin From mhammond at users.sourceforge.net Sat Feb 7 21:14:50 2004 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sat Feb 7 21:17:43 2004 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs processors.py, 1.14, 1.15 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30576/Outlook2000/dialogs Modified Files: processors.py Log Message: Options without a docstring would cause an exception Index: processors.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/processors.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** processors.py 20 Dec 2003 11:17:47 -0000 1.14 --- processors.py 8 Feb 2004 02:14:48 -0000 1.15 *************** *** 104,106 **** def GetPopupHelpText(self, ctrlid): assert ctrlid == self.control_id ! return " ".join(self.func.__doc__.split()) --- 104,109 ---- def GetPopupHelpText(self, ctrlid): assert ctrlid == self.control_id ! doc = self.func.__doc__ ! if doc is None: ! return "" ! return " ".join(doc.split()) From mhammond at users.sourceforge.net Sat Feb 7 21:15:35 2004 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sat Feb 7 21:18:27 2004 Subject: [Spambayes-checkins] spambayes/Outlook2000/sandbox dump_profiles.py, 1.1, 1.2 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/sandbox In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30686/Outlook2000/sandbox Modified Files: dump_profiles.py Log Message: Remove unused module import Index: dump_profiles.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/sandbox/dump_profiles.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dump_profiles.py 16 Jun 2003 04:51:29 -0000 1.1 --- dump_profiles.py 8 Feb 2004 02:15:33 -0000 1.2 *************** *** 1,5 **** from win32com.client import Dispatch ! from win32com.mapi import mapi, exchange from win32com.mapi.mapitags import * --- 1,5 ---- from win32com.client import Dispatch ! from win32com.mapi import mapi from win32com.mapi.mapitags import * From anadelonbrin at users.sourceforge.net Sat Feb 7 21:45:41 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sat Feb 7 21:48:34 2004 Subject: [Spambayes-checkins] spambayes README-DEVEL.txt, 1.11, 1.12 README.txt, 1.64, 1.65 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3668 Modified Files: README-DEVEL.txt README.txt Log Message: The fact that sb_imapfilter 'changes' messages, even when just training, has surprised many people, so put something in the readme to explain why, and point out that this will happen. Also add a note in the build instructions for those that don't like/use WinCVS, like me :) Index: README-DEVEL.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/README-DEVEL.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** README-DEVEL.txt 5 Dec 2003 04:45:44 -0000 1.11 --- README-DEVEL.txt 8 Feb 2004 02:45:37 -0000 1.12 *************** *** 483,487 **** o Checkout the 'spambayes' module twice, once with Windows line endings and once with Unix line endings (I use WinCVS for this, using "Admin / ! Preferences / Globals / Checkout text files with the Unix LF". o Change spambayes/__init__.py to contain the new version number but don't commit it yet, just in case something goes wrong. --- 483,489 ---- o Checkout the 'spambayes' module twice, once with Windows line endings and once with Unix line endings (I use WinCVS for this, using "Admin / ! Preferences / Globals / Checkout text files with the Unix LF". If you ! use TortoiseCVS, like Tony, then the option is on the Options tab in ! the checkout dialog). o Change spambayes/__init__.py to contain the new version number but don't commit it yet, just in case something goes wrong. Index: README.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/README.txt,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** README.txt 7 Jan 2004 23:54:17 -0000 1.64 --- README.txt 8 Feb 2004 02:45:37 -0000 1.65 *************** *** 292,295 **** --- 292,302 ---- not classified as spam into (one of) the folder(s) that you specified as a spam training folder in the steps above. + + Note that training, even without any classifying, using the IMAP filter, + means that your messages will be recreated (i.e. the old one is marked for + deletion and a new copy is made) on the server. The messages will be + identical to the original, except that they will include an additional + header, so that SpamBayes can keep track of which messages have already + been processed. From mhammond at users.sourceforge.net Sun Feb 8 17:29:48 2004 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Feb 8 17:32:50 2004 Subject: [Spambayes-checkins] spambayes/Outlook2000 manager.py,1.95,1.96 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29888 Modified Files: manager.py Log Message: Fix the location of the doc files in the binary build Index: manager.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/manager.py,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** manager.py 20 Dec 2003 11:21:09 -0000 1.95 --- manager.py 8 Feb 2004 22:29:45 -0000 1.96 *************** *** 876,882 **** if urllib.splittype(url)[0] is None: # just a file spec if hasattr(sys, "frozen"): ! # Same directory as to the executable. fname = os.path.join(os.path.dirname(sys.argv[0]), ! url) else: # (ie, main Outlook2000) dir --- 876,887 ---- if urllib.splittype(url)[0] is None: # just a file spec if hasattr(sys, "frozen"): ! # New binary is in ../docs/outlook relative to executable. fname = os.path.join(os.path.dirname(sys.argv[0]), ! "../docs/outlook", ! url) ! if not os.path.isfile(fname): ! # Still support same directory as to the executable. ! fname = os.path.join(os.path.dirname(sys.argv[0]), ! url) else: # (ie, main Outlook2000) dir From mhammond at users.sourceforge.net Sun Feb 8 22:59:27 2004 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Sun Feb 8 23:02:31 2004 Subject: [Spambayes-checkins] spambayes/Outlook2000 addin.py,1.126,1.127 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28367 Modified Files: addin.py Log Message: A new error message would popup way too often once the error happened. Switch to using ReportErrorOnce. Also change the text to make it wrap in the dialog better, and be more generic. Index: addin.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/addin.py,v retrieving revision 1.126 retrieving revision 1.127 diff -C2 -d -r1.126 -r1.127 *** addin.py 5 Feb 2004 08:40:22 -0000 1.126 --- addin.py 9 Feb 2004 03:59:24 -0000 1.127 *************** *** 1102,1110 **** except: print "Error finding the MAPI folders for a folder switch event" ! self.manager.ReportError("You must configure the Possible Spam/Spam folder\n" \ ! "(Maybe you deleted the folder, rather than " \ ! "the items in it? If so, create a new folder " \ ! "and use the Manager to select it)", ! "Invalid Configuration") traceback.print_exc() if self.but_recover_as is not None: --- 1102,1112 ---- except: print "Error finding the MAPI folders for a folder switch event" ! # As this happens once per move, we should only display it once. ! self.manager.ReportErrorOnce( ! "There appears to be a problem with the SpamBayes" ! " configuration\r\n\r\nPlease select the SpamBayes" ! " manager, and run the\r\nConfiguration Wizard to" ! " reconfigure the filter.", ! "Invalid SpamBayes Configuration") traceback.print_exc() if self.but_recover_as is not None: From anadelonbrin at users.sourceforge.net Mon Feb 9 00:34:18 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Feb 9 00:37:23 2004 Subject: [Spambayes-checkins] spambayes CHANGELOG.txt,1.35,1.36 Message-ID: Update of /cvsroot/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11757 Modified Files: CHANGELOG.txt Log Message: Bring up to date. Index: CHANGELOG.txt =================================================================== RCS file: /cvsroot/spambayes/spambayes/CHANGELOG.txt,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** CHANGELOG.txt 5 Feb 2004 09:41:49 -0000 1.35 --- CHANGELOG.txt 9 Feb 2004 05:34:16 -0000 1.36 *************** *** 3,6 **** --- 3,7 ---- Alpha Release 9 =============== + Skip Montanaro 07/02/2004 New script - tte.py: Train to exhaustion based upon my understanding of the technique as described in Gary Robinson's blog. Tony Meyer 05/02/2004 Web interface: added a third configuration page, which dynamically has all the experimental options (not the deprecated ones). Tony Meyer 05/02/2004 Make all the scripts consistent in their command line setting of database type/name. -d is dbm, -p is pickle. Also setup things nicer for mysql and pgsql. From anadelonbrin at users.sourceforge.net Mon Feb 9 01:16:43 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Feb 9 01:19:48 2004 Subject: [Spambayes-checkins] spambayes/spambayes __init__.py,1.8,1.9 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19143/spambayes Modified Files: __init__.py Log Message: Update for the imminent release. Index: __init__.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/__init__.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** __init__.py 5 Dec 2003 04:41:25 -0000 1.8 --- __init__.py 9 Feb 2004 06:16:40 -0000 1.9 *************** *** 1,3 **** # package marker. ! __version__ = '1.0a7' --- 1,3 ---- # package marker. ! __version__ = '1.0a9' From anadelonbrin at users.sourceforge.net Mon Feb 9 01:44:44 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Feb 9 01:47:50 2004 Subject: [Spambayes-checkins] website applications.ht, 1.25, 1.26 download.ht, 1.21, 1.22 faq.txt, 1.59, 1.60 index.ht, 1.30, 1.31 reply.txt, 1.10, 1.11 windows.ht, 1.32, 1.33 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23911 Modified Files: applications.ht download.ht faq.txt index.ht reply.txt windows.ht Log Message: Update for the imminent release. Please don't push this to the live site until the release is official! Index: applications.ht =================================================================== RCS file: /cvsroot/spambayes/website/applications.ht,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** applications.ht 5 Nov 2003 13:21:38 -0000 1.25 --- applications.ht 9 Feb 2004 06:44:41 -0000 1.26 *************** *** 14,18 ****

Requirements

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

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

Requirements

    !
  • Outlook 2000 or above (not Outlook Express)

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

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

!

Download the alpha7 release.

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

sb_filter.py

!

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

--- 29,39 ----

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

!

Download the alpha9 release.

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

sb_filter.py

!

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 the alpha7 release.

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

--- 45,49 ----

Availability

!

Download the alpha9 release.

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

*************** *** 59,63 ****

Availability

!

Download the alpha7 release.

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

--- 60,66 ----

Availability

!

Windows users can now download an installer for a binary version of sb_server, ! including a tray application to access it. Download the 009 release.

!

Alternatively, to run from source, download the alpha9 release.

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

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

Availability

!

Download the alpha7 release.

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

--- 77,81 ----

Availability

!

Download the alpha9 release.

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

*************** *** 90,94 ****

Availability

!

Download the alpha7 release.

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

--- 93,97 ----

Availability

!

Download the alpha9 release.

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

*************** *** 108,111 ****

Availability

!

Download the alpha7 release.

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

--- 111,114 ----

Availability

!

Download the alpha9 release.

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

Index: download.ht =================================================================== RCS file: /cvsroot/spambayes/website/download.ht,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** download.ht 5 Nov 2003 12:15:41 -0000 1.21 --- download.ht 9 Feb 2004 06:44:41 -0000 1.22 *************** *** 4,17 ****

Source Releases

!

The seventh alpha release of version 1.0 of the SpamBayes project is available. ! Download version 1.0a7 from the sourceforge Files page as either a gzipped tarball or a zip file of the source files.

!

This release is primarily to shake out a few bugs on the way to a 1.0 ! release. ! Version 1.0 is now in 'feature freeze', so, while we will continue to resolve any bugs, no new features will be added. This means ! that a beta, and then final, release for version 1.0 is not too far off. New features will be added to the 1.1a1 release. ! Feedback to spambayes@python.org.

Prerequisites:

    Either: --- 4,15 ----

    Source Releases

    !

    Alpha release 9 of version 1.0 of the SpamBayes project is now available. ! Download version 1.0a9 from the sourceforge Files ! page as either a gzipped tarball or a zip file of the source files.

    !

    This release is primarily to shake out those last few bugs on the way to a 1.0 ! release. Feedback to spambayes@python.org.

    Prerequisites:

      Either: *************** *** 28,34 ****

      Binary Releases

      Outlook Plugin

      !

      Mark has packaged up a standalone installer of the Outlook plugin. Get it from the Windows page on this site.

      Other

      None as yet.

      --- 26,37 ----

      Binary Releases

      Outlook Plugin

      !

      Mark has packaged up a standalone installer of the Outlook plugin. Get it from the Windows page on this site.

      +

      sb_server

      +

      Windows users that get mail via POP3, who do not use Outlook, can now + get a standalone installer of sb_server. Get it from the + Windows page on this site.

      +

      Other

      None as yet.

      Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** faq.txt 6 Feb 2004 22:44:53 -0000 1.59 --- faq.txt 9 Feb 2004 06:44:41 -0000 1.60 *************** *** 116,120 **** site:mail.python.org sb_server -checkins ! would search for messages which mention sb_server but exclude checkin messages. --- 116,120 ---- site:mail.python.org sb_server -checkins ! would search for messages which mention sb_server but exclude check-in messages. *************** *** 131,136 **** Unless you want to run from the source code, all you need is the ! SpamBayes installer. At present, unless you want to use the Outlook ! plug-in, you must run from source. This will change in the near future. If you want to run from source, you must have a recent version of --- 131,137 ---- Unless you want to run from the source code, all you need is the ! SpamBayes installer. At present, any Windows users using Outlook or using ! any other mail client and retrieving mail via POP3 can use the installer. ! At present, all other users must run from source. If you want to run from source, you must have a recent version of *************** *** 173,177 **** 3. The POP3 proxy. This sits between your email client (Eudora, Outlook Express, etc) and your incoming email server, and adds the classification ! header to emails as you download them. A typical user's email setup looks like this:: --- 174,180 ---- 3. The POP3 proxy. This sits between your email client (Eudora, Outlook Express, etc) and your incoming email server, and adds the classification ! header to emails as you download them. The proxy is run by the sb_server ! script, and, on Windows, can be controlled via a 'tray application' (an ! icon that appears in the tray next to the clock). A typical user's email setup looks like this:: *************** *** 357,361 **** Users limited to POP3/IMAP communications to the server can use the POP3_ or ! proxy or IMAP_ filter which are part of the SpamBayes source. .. _POP3: applications.html#sb_server --- 360,364 ---- Users limited to POP3/IMAP communications to the server can use the POP3_ or ! proxy or IMAP_ filter which are part of the SpamBayes package. .. _POP3: applications.html#sb_server *************** *** 1248,1251 **** --- 1251,1259 ---- distribution - we're filing neat ideas here. + If you're interested in trying out other people's cool ideas, as well as your + own, then check out the current experimental options (these start with "x-", + and are available via the web interface on the Experimental Configuration page) + and give us some feedback about how they work for you. + Are there plans to develop a server-side SpamBayes solution? Index: index.ht =================================================================== RCS file: /cvsroot/spambayes/website/index.ht,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** index.ht 5 Nov 2003 12:31:55 -0000 1.30 --- index.ht 9 Feb 2004 06:44:42 -0000 1.31 *************** *** 5,11 ****

      News

      !

      Seventh alpha release of spambayes available. See the ! download page for more.

      !

      Outlook plugin release 008 is available. See the Windows page for more. Note that the Outlook plugin is now available from Sourceforge, on this project's Files page.

      You may also like to see what other people have been saying about us in the press and elsewhere.

      --- 5,15 ----

      News

      !

      The 1.0alpha9 release of the SpamBayes source is available, as is ! the 0.9 release of the binary installer for the Outlook plug-in.

      !

      The binary installer also includes the first release of ! a binary version of sb_server (aka pop3proxy). If you use sb_server, ! please give this version a go and let us know how it goes (you no ! longer need to have Python installed with the binary version).

      !

      See the download page for more.

      You may also like to see what other people have been saying about us in the press and elsewhere.

      *************** *** 49,53 **** ! Pop3proxy A mail filter which sits between the user's POP3 server(s) and the user's mail client and presents a web-based training interface --- 53,57 ---- ! Pop3proxy / sb_server A mail filter which sits between the user's POP3 server(s) and the user's mail client and presents a web-based training interface *************** *** 61,65 **** ! Hammiefilter A simple mail filter suitable for embedding in a procmail environment --- 65,69 ---- ! Hammiefilter / sb_filter A simple mail filter suitable for embedding in a procmail environment *************** *** 138,142 ****

      The code is currently available from a variety of methods from the downloads page. The current release is ! 1.0alpha7.

      --- 142,146 ----

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

      Index: reply.txt =================================================================== RCS file: /cvsroot/spambayes/website/reply.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** reply.txt 5 Nov 2003 12:31:46 -0000 1.10 --- reply.txt 9 Feb 2004 06:44:42 -0000 1.11 *************** *** 38,45 **** ----------------------------------------------- ! Please ensure that you have the latest version. As of 2003-11-05, this is ! 008.1 for the Outlook plug-in, and 1.0a7 for everything else. If you are ! still having trouble, try looking at the bug reports that are currently ! open: http://sf.net/tracker/?group_id=61702&atid=498103 --- 38,45 ---- ----------------------------------------------- ! Please ensure that you have the latest version. As of 2004-02-09, this is ! 1.0a9 for the source, and 0.9 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: http://sf.net/tracker/?group_id=61702&atid=498103 Index: windows.ht =================================================================== RCS file: /cvsroot/spambayes/website/windows.ht,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** windows.ht 21 Jan 2004 02:25:58 -0000 1.32 --- windows.ht 9 Feb 2004 06:44:42 -0000 1.33 *************** *** 8,17 **** and for all other mail clients !

      Outlook 2003/2000/XP

      Latest Release

      !

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

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

      Outlook 2000/XP/2003

      Latest Release

      !

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

      *************** *** 55,59 **** Python you downloaded. !
    • The Spambayes source, either as a zip file or via --- 55,59 ---- Python you downloaded.
    • !
    • The SpamBayes source, either as a zip file or via *************** *** 72,81 ****

      Non Outlook Solutions

      !

      If you use any other mail client on Windows, you currently need to install a recent version of Python and the Spambayes ! source1, then setup the proxy server ! (POP3 or IMAP) which corresponds to the way in ! which you transfer mail from your mail server. --- 72,86 ----

      Non Outlook Solutions

      !

      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.

      !

      See also the information about sb_server.

      ! !

      If you retrieve mail via IMAP, you, you currently need to install a recent version of Python and the SpamBayes ! source1, then setup the IMAP filter) for your mail server. From mhammond at users.sourceforge.net Mon Feb 9 17:45:02 2004 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Mon Feb 9 17:48:17 2004 Subject: [Spambayes-checkins] spambayes/windows spambayes.iss,1.8,1.9 Message-ID: Update of /cvsroot/spambayes/spambayes/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7400 Modified Files: spambayes.iss Log Message: Bump version numbers in installation EXE. Index: spambayes.iss =================================================================== RCS file: /cvsroot/spambayes/spambayes/windows/spambayes.iss,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** spambayes.iss 29 Jan 2004 18:27:54 -0000 1.8 --- spambayes.iss 9 Feb 2004 22:44:58 -0000 1.9 *************** *** 4,14 **** [Setup] AppName=SpamBayes - AppVerName=SpamBayes Experimental Binary - AppVersion=0.85 DefaultDirName={pf}\SpamBayes DefaultGroupName=SpamBayes OutputDir=. - OutputBaseFilename=SpamBayes-Setup ShowComponentSizes=no UninstallDisplayIcon={app}\sbicon.ico --- 4,16 ---- [Setup] + ; Version specific constants + AppVerName=SpamBayes 1.0a9 (0.9) + AppVersion=0.90 + OutputBaseFilename=spambayes-1.0a9 + ; Normal constants. Be careful about changing 'AppName' AppName=SpamBayes DefaultDirName={pf}\SpamBayes DefaultGroupName=SpamBayes OutputDir=. ShowComponentSizes=no UninstallDisplayIcon={app}\sbicon.ico From kpitt at users.sourceforge.net Tue Feb 10 13:54:41 2004 From: kpitt at users.sourceforge.net (Kenny Pitt) Date: Tue Feb 10 13:58:03 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_dbexpimp.py,1.6,1.7 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23417 Modified Files: sb_dbexpimp.py Log Message: Fix typo in usage statement. Index: sb_dbexpimp.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_dbexpimp.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sb_dbexpimp.py 5 Feb 2004 08:13:26 -0000 1.6 --- sb_dbexpimp.py 10 Feb 2004 18:54:38 -0000 1.7 *************** *** 49,53 **** -f: FN : flat file to export to or import from -p: FN : name of pickled database file to use ! -f: FN : name of dbm database file to use -m : merge import into an existing database file. This is meaningful only for import. If omitted, a new database --- 49,53 ---- -f: FN : flat file to export to or import from -p: FN : name of pickled database file to use ! -d: FN : name of dbm database file to use -m : merge import into an existing database file. This is meaningful only for import. If omitted, a new database From montanaro at users.sourceforge.net Wed Feb 11 09:43:09 2004 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Wed Feb 11 09:46:40 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_filter.py,1.11,1.12 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31358 Modified Files: sb_filter.py Log Message: Big speedup when using sb_filter.py to process an entire mailbox. Instead of opening the database for each filter operation, cache the open db object and reuse as long as its mode is the same as the last time we used it. Index: sb_filter.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_filter.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** sb_filter.py 5 Feb 2004 08:13:26 -0000 1.11 --- sb_filter.py 11 Feb 2004 14:43:06 -0000 1.12 *************** *** 153,189 **** os.path.expanduser('~/.hammierc')]) self.dbname, self.usedb = storage.database_type([]) def newdb(self): ! h = hammie.open(self.dbname, self.usedb, 'n') ! h.store() print >> sys.stderr, "Created new database in", self.dbname def filter(self, msg): ! h = hammie.open(self.dbname, self.usedb, 'r') ! return h.filter(msg) def filter_train(self, msg): ! h = hammie.open(self.dbname, self.usedb, 'c') ! return h.filter(msg, train=True) def train_ham(self, msg): ! h = hammie.open(self.dbname, self.usedb, 'c') ! h.train_ham(msg, True) ! h.store() def train_spam(self, msg): ! h = hammie.open(self.dbname, self.usedb, 'c') ! h.train_spam(msg, True) ! h.store() def untrain_ham(self, msg): ! h = hammie.open(self.dbname, self.usedb, 'c') ! h.untrain_ham(msg) ! h.store() def untrain_spam(self, msg): ! h = hammie.open(self.dbname, self.usedb, 'c') ! h.untrain_spam(msg) ! h.store() def main(): --- 153,208 ---- os.path.expanduser('~/.hammierc')]) self.dbname, self.usedb = storage.database_type([]) + self.h = None + + def open(self, mode): + if self.h is None or self.mode != mode: + if self.h is not None: + if self.mode != 'r': + self.h.store() + self.h.close() + self.mode = mode + self.h = hammie.open(self.dbname, self.usedb, self.mode) + + def close(self): + if self.h is not None: + if self.mode != 'r': + self.h.store() + self.h.close() + self.h = None + + __del__ = close def newdb(self): ! self.open('n') ! self.close() print >> sys.stderr, "Created new database in", self.dbname def filter(self, msg): ! self.open('r') ! return self.h.filter(msg) def filter_train(self, msg): ! self.open('c') ! return self.h.filter(msg, train=True) def train_ham(self, msg): ! self.open('c') ! self.h.train_ham(msg, True) ! self.h.store() def train_spam(self, msg): ! self.open('c') ! self.h.train_spam(msg, True) ! self.h.store() def untrain_ham(self, msg): ! self.open('c') ! self.h.untrain_ham(msg) ! self.h.store() def untrain_spam(self, msg): ! self.open('c') ! self.h.untrain_spam(msg) ! self.h.store() def main(): From montanaro at users.sourceforge.net Wed Feb 11 09:55:49 2004 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Wed Feb 11 09:59:17 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_filter.py,1.12,1.13 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1988 Modified Files: sb_filter.py Log Message: hammie objects don't have close() methods Index: sb_filter.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_filter.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** sb_filter.py 11 Feb 2004 14:43:06 -0000 1.12 --- sb_filter.py 11 Feb 2004 14:55:47 -0000 1.13 *************** *** 160,164 **** if self.mode != 'r': self.h.store() - self.h.close() self.mode = mode self.h = hammie.open(self.dbname, self.usedb, self.mode) --- 160,163 ---- *************** *** 168,172 **** if self.mode != 'r': self.h.store() - self.h.close() self.h = None --- 167,170 ---- From anadelonbrin at users.sourceforge.net Thu Feb 12 16:03:24 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Feb 12 16:07:07 2004 Subject: [Spambayes-checkins] spambayes/windows .cvsignore,1.1,1.2 Message-ID: Update of /cvsroot/spambayes/spambayes/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6918/windows Modified Files: .cvsignore Log Message: Ignore autogenerated installers. Index: .cvsignore =================================================================== RCS file: /cvsroot/spambayes/spambayes/windows/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 15 Dec 2003 08:10:43 -0000 1.1 --- .cvsignore 12 Feb 2004 21:03:16 -0000 1.2 *************** *** 1 **** ! SpamBayes-Setup.exe \ No newline at end of file --- 1,2 ---- ! SpamBayes-Setup.exe ! spambayes-*.exe \ No newline at end of file From sjoerd at users.sourceforge.net Thu Feb 12 16:11:30 2004 From: sjoerd at users.sourceforge.net (Sjoerd Mullender) Date: Thu Feb 12 16:15:13 2004 Subject: [Spambayes-checkins] spambayes/windows .cvsignore,1.2,1.3 Message-ID: Update of /cvsroot/spambayes/spambayes/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8576 Modified Files: .cvsignore Log Message: Add newline to the end of the file. Index: .cvsignore =================================================================== RCS file: /cvsroot/spambayes/spambayes/windows/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 12 Feb 2004 21:03:16 -0000 1.2 --- .cvsignore 12 Feb 2004 21:11:26 -0000 1.3 *************** *** 1,2 **** SpamBayes-Setup.exe ! spambayes-*.exe \ No newline at end of file --- 1,2 ---- SpamBayes-Setup.exe ! spambayes-*.exe From anadelonbrin at users.sourceforge.net Thu Feb 12 16:36:17 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Feb 12 16:39:58 2004 Subject: [Spambayes-checkins] spambayes/spambayes message.py,1.46,1.47 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14097/spambayes Modified Files: message.py Log Message: Fix [ 895606 ] 1.0a9 proxy raises an X-Spambayes-Exception Index: message.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/message.py,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** message.py 12 Jan 2004 08:42:53 -0000 1.46 --- message.py 12 Feb 2004 21:36:14 -0000 1.47 *************** *** 398,402 **** # allow filtering in 'stripped down' mailers like Outlook Express, # so for the moment, they stay in. ! if disposition in options["Headers", "notate_to"]: try: self.replace_header("To", "%s,%s" % (disposition, --- 398,412 ---- # allow filtering in 'stripped down' mailers like Outlook Express, # so for the moment, they stay in. ! # options["Headers", "notate_to"] (and notate_subject) can be ! # either a single string (like "spam") or a tuple (like ! # ("unsure", "spam")). In Python 2.3 checking for a string in ! # something that could be a string or a tuple works fine, but ! # it dies in Python 2.2, because you can't do 'string in string', ! # only 'character in string', so we allow for that. ! if isinstance(options["Headers", "notate_to"], types.StringTypes): ! notate_to = (options["Headers", "notate_to"],) ! else: ! notate_to = options["Headers", "notate_to"] ! if disposition in notate_to: try: self.replace_header("To", "%s,%s" % (disposition, *************** *** 405,409 **** self["To"] = disposition ! if disposition in options["Headers", "notate_subject"]: try: self.replace_header("Subject", "%s,%s" % (disposition, --- 415,423 ---- self["To"] = disposition ! if isinstance(options["Headers", "notate_subject"], types.StringTypes): ! notate_subject = (options["Headers", "notate_subject"],) ! else: ! notate_subject = options["Headers", "notate_subject"] ! if disposition in notate_subject: try: self.replace_header("Subject", "%s,%s" % (disposition, From montanaro at users.sourceforge.net Thu Feb 12 17:03:29 2004 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Thu Feb 12 17:07:18 2004 Subject: [Spambayes-checkins] spambayes/contrib tte.py,1.1,1.2 Message-ID: Update of /cvsroot/spambayes/spambayes/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20763 Modified Files: tte.py Log Message: record time (in seconds) to execute each round and count the number of leftover hams and spams at the end Index: tte.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/contrib/tte.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tte.py 6 Feb 2004 21:58:15 -0000 1.1 --- tte.py 12 Feb 2004 22:03:27 -0000 1.2 *************** *** 24,30 **** --- 24,33 ---- """ + from __future__ import division + import sys import getopt import os + import datetime from spambayes import storage *************** *** 50,53 **** --- 53,57 ---- round += 1 hmisses = smisses = nmsgs = 0 + start = datetime.datetime.now() try: while not maxmsgs or nmsgs < maxmsgs: *************** *** 69,75 **** except StopIteration: pass ! ! print "\rround: %2d, msgs: %4d, ham misses: %3d, spam misses: %3d" % \ ! (round, nmsgs, hmisses, smisses) def main(args): --- 73,98 ---- except StopIteration: pass ! ! delta = datetime.datetime.now()-start ! seconds = delta.seconds + delta.microseconds/1000000 ! ! print "\rround: %2d, msgs: %4d, ham misses: %3d, spam misses: %3d, %.3fs" % \ ! (round, nmsgs, hmisses, smisses, seconds) ! ! nhamleft = 0 ! try: ! while True: ! hambone.next() ! nhamleft += 1 ! except StopIteration: ! if nhamleft: print nhamleft, "untrained hams" ! ! nspamleft = 0 ! try: ! while True: ! spamcan.next() ! nspamleft += 1 ! except StopIteration: ! if nspamleft: print nspamleft, "untrained spams" def main(args): From montanaro at users.sourceforge.net Thu Feb 12 17:07:58 2004 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Thu Feb 12 17:11:40 2004 Subject: [Spambayes-checkins] spambayes/spambayes tokenizer.py,1.30,1.31 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21901 Modified Files: tokenizer.py Log Message: Collect all potential MTA complaints, not just sendmail's "may be forged" (from Tim Peters). Index: tokenizer.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/tokenizer.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** tokenizer.py 29 Jan 2004 15:02:11 -0000 1.30 --- tokenizer.py 12 Feb 2004 22:07:55 -0000 1.31 *************** *** 649,653 **** # by manatee.mojam.com (8.12.1-20030917/8.12.1/Submit) id hBIEQFxF018044 # for skip@manatee.mojam.com; Thu, 18 Dec 2003 08:26:15 -0600 ! received_host_re = re.compile(r'from ([a-zA-Z0-9._-]+[a-zA-Z])[)\s]') # 99% of the time, the receiving host places the sender's ip address in # square brackets as it should, but every once in awhile it turns up in --- 649,653 ---- # by manatee.mojam.com (8.12.1-20030917/8.12.1/Submit) id hBIEQFxF018044 # for skip@manatee.mojam.com; Thu, 18 Dec 2003 08:26:15 -0600 ! received_host_re = re.compile(r'from ([a-z0-9._-]+[a-z])[)\s]') # 99% of the time, the receiving host places the sender's ip address in # square brackets as it should, but every once in awhile it turns up in *************** *** 1093,1096 **** --- 1093,1098 ---- return tokens + received_complaints_re = re.compile(r'\([a-z]+(?:\s+[a-z]+)+\)') + class SlurpingURLStripper(URLStripper): def __init__(self): *************** *** 1452,1467 **** if options["Tokenizer", "mine_received_headers"]: for header in msg.get_all("received", ()): ! # Sendmail adds a chit to Received: headers if it thinks ! # the sender is forging its identity. That seems to be ! # a pretty reliable spam clue. I'll leave it for others ! # to decide if this should be pulled outside the check ! # for mine_received_headers. ! if header.lower().find('may be forged') != -1: ! yield 'received:may be forged' for pat, breakdown in [(received_host_re, breakdown_host), (received_ip_re, breakdown_ipaddr)]: m = pat.search(header) if m: ! for tok in breakdown(m.group(1).lower()): yield 'received:' + tok --- 1454,1470 ---- if options["Tokenizer", "mine_received_headers"]: for header in msg.get_all("received", ()): ! # everything here should be case insensitive and not be ! # split across continuation lines, so normalize whitespace ! # and letter case just once per header ! header = ' '.join(header.split()).lower() ! ! for clue in received_complaints_re.findall(header): ! yield 'received:' + clue ! for pat, breakdown in [(received_host_re, breakdown_host), (received_ip_re, breakdown_ipaddr)]: m = pat.search(header) if m: ! for tok in breakdown(m.group(1)): yield 'received:' + tok From montanaro at users.sourceforge.net Fri Feb 13 10:09:36 2004 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Fri Feb 13 10:13:26 2004 Subject: [Spambayes-checkins] spambayes/contrib tte.py,1.2,1.3 Message-ID: Update of /cvsroot/spambayes/spambayes/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18616 Modified Files: tte.py Log Message: no need to be quite so "accurate" with the timing Index: tte.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/contrib/tte.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tte.py 12 Feb 2004 22:03:27 -0000 1.2 --- tte.py 13 Feb 2004 15:09:33 -0000 1.3 *************** *** 77,81 **** seconds = delta.seconds + delta.microseconds/1000000 ! print "\rround: %2d, msgs: %4d, ham misses: %3d, spam misses: %3d, %.3fs" % \ (round, nmsgs, hmisses, smisses, seconds) --- 77,81 ---- seconds = delta.seconds + delta.microseconds/1000000 ! print "\rround: %2d, msgs: %4d, ham misses: %3d, spam misses: %3d, %.1fs" % \ (round, nmsgs, hmisses, smisses, seconds) From kpitt at users.sourceforge.net Fri Feb 13 14:18:47 2004 From: kpitt at users.sourceforge.net (Kenny Pitt) Date: Fri Feb 13 14:22:38 2004 Subject: [Spambayes-checkins] website windows.ht,1.33,1.34 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17909 Modified Files: windows.ht Log Message: Fix release notes link that was still pointing to 0.8 (reported by Seth Goodman). Also fix some typos in the IMAP Filter section and change some https links to plain http. Index: windows.ht =================================================================== RCS file: /cvsroot/spambayes/website/windows.ht,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** windows.ht 9 Feb 2004 06:44:42 -0000 1.33 --- windows.ht 13 Feb 2004 19:18:45 -0000 1.34 *************** *** 12,17 ****

      Latest Release

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

      --- 12,17 ----

      Latest Release

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

      *************** *** 27,31 ****

      In general, you should download and install the latest version, as shown above. Older versions and the release notes can be viewed at the ! spambayes releases page.

      --- 27,31 ----

      In general, you should download and install the latest version, as shown above. Older versions and the release notes can be viewed at the ! spambayes releases page.

      *************** *** 56,60 ****
    • The SpamBayes source, either as a zip file or via CVS. The zip file will probably be easier to handle, but there are --- 56,60 ----
    • The SpamBayes source, either as a zip file or via CVS. The zip file will probably be easier to handle, but there are *************** *** 74,86 ****

      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.

      See also the information about sb_server.

      !

      If you retrieve mail via IMAP, you, you currently need to install a recent version of Python and the SpamBayes source1, then setup the IMAP filter) for your mail server. --- 74,86 ----

      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.

      See also the information about sb_server.

      !

      If you retrieve mail via IMAP, you currently need to install a recent version of Python and the SpamBayes source1, then setup the IMAP filter) for your mail server. From montanaro at users.sourceforge.net Fri Feb 13 14:43:39 2004 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Fri Feb 13 14:47:29 2004 Subject: [Spambayes-checkins] spambayes/contrib tte.py,1.3,1.4 Message-ID: Update of /cvsroot/spambayes/spambayes/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23880 Modified Files: tte.py Log Message: set a user-settable upper limit on the number of rounds to prevent infinite loops. Index: tte.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/contrib/tte.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tte.py 13 Feb 2004 15:09:33 -0000 1.3 --- tte.py 13 Feb 2004 19:43:36 -0000 1.4 *************** *** 5,9 **** everything scores properly. ! usage %(prog)s [ -h ] -g file -s file [ -d file | -p file ] [ -m N ] -h - print this documentation and exit. --- 5,9 ---- everything scores properly. ! usage %(prog)s [ -h ] -g file -s file [ -d file | -p file ] [ -m N ] [ -r N ] -h - print this documentation and exit. *************** *** 19,22 **** --- 19,25 ---- -m N - train on at most N messages (nham == N/2 and nspam == N/2) + -r N - run at most N rounds (default %(MAXROUNDS)s), even if not + all messages score correctly + See Gary Robinson's blog: *************** *** 38,41 **** --- 41,46 ---- prog = os.path.basename(sys.argv[0]) + MAXROUNDS = 10 + def usage(msg=None): if msg is not None: *************** *** 43,52 **** print >> sys.stderr, __doc__.strip() % globals() ! def train(store, ham, spam, maxmsgs): smisses = hmisses = round = 0 ham_cutoff = Options.options["Categorization", "ham_cutoff"] spam_cutoff = Options.options["Categorization", "spam_cutoff"] ! while hmisses or smisses or round == 0: hambone = mboxutils.getmbox(ham) spamcan = mboxutils.getmbox(spam) --- 48,57 ---- print >> sys.stderr, __doc__.strip() % globals() ! def train(store, ham, spam, maxmsgs, maxrounds): smisses = hmisses = round = 0 ham_cutoff = Options.options["Categorization", "ham_cutoff"] spam_cutoff = Options.options["Categorization", "spam_cutoff"] ! while round < maxrounds and (hmisses or smisses or round == 0): hambone = mboxutils.getmbox(ham) spamcan = mboxutils.getmbox(spam) *************** *** 98,105 **** def main(args): try: ! opts, args = getopt.getopt(args, "hg:s:d:p:o:m:", ["help", "good=", "spam=", "database=", "pickle=", ! "option=", "max="]) except getopt.GetoptError, msg: usage(msg) --- 103,110 ---- def main(args): try: ! opts, args = getopt.getopt(args, "hg:s:d:p:o:m:r:", ["help", "good=", "spam=", "database=", "pickle=", ! "option=", "max=", "maxrounds="]) except getopt.GetoptError, msg: usage(msg) *************** *** 108,111 **** --- 113,117 ---- ham = spam = dbname = usedb = None maxmsgs = 0 + maxrounds = MAXROUNDS for opt, arg in opts: if opt in ("-h", "--help"): *************** *** 118,121 **** --- 124,129 ---- elif opt in ("-m", "--max"): maxmsgs = int(arg) + elif opt in ("-r", "--maxrounds"): + maxrounds = int(arg) elif opt in ('-o', '--option'): Options.options.set_from_cmdline(arg, sys.stderr) *************** *** 134,138 **** store = storage.open_storage(dbname, usedb) ! train(store, ham, spam, maxmsgs) store.store() --- 142,146 ---- store = storage.open_storage(dbname, usedb) ! train(store, ham, spam, maxmsgs, maxrounds) store.store() From mhammond at users.sourceforge.net Fri Feb 13 19:44:43 2004 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Fri Feb 13 19:48:38 2004 Subject: [Spambayes-checkins] website Makefile,1.17,1.18 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18784 Modified Files: Makefile Log Message: Force the filename of Version.py to use "/" instead of "\", as the latter confused the shell (or make, or something, but the command-line ended up not seeing the slashes on Windows. Index: Makefile =================================================================== RCS file: /cvsroot/spambayes/website/Makefile,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Makefile 5 Nov 2003 12:05:19 -0000 1.17 --- Makefile 14 Feb 2004 00:44:38 -0000 1.18 *************** *** 19,23 **** from spambayes import Version;\ f = Version.__file__;\ ! print os.path.splitext(f)[0]+".py";\ ') --- 19,23 ---- from spambayes import Version;\ f = Version.__file__;\ ! print (os.path.splitext(f)[0]+".py").replace("\\", "/");\ ') From anadelonbrin at users.sourceforge.net Sat Feb 14 21:15:54 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sat Feb 14 21:19:57 2004 Subject: [Spambayes-checkins] spambayes/spambayes Stats.py,1.5,1.6 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20372/spambayes Modified Files: Stats.py Log Message: Fix half of [ 896366 ] Crashes in the web interface. It seems that with Python 2.2 iterating through the shelve object doesn't give the shelve's keys, like it does in Python 2.3. Explicity use the keys to fix this. Index: Stats.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/Stats.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Stats.py 19 Jan 2004 17:58:28 -0000 1.5 --- Stats.py 15 Feb 2004 02:15:51 -0000 1.6 *************** *** 56,60 **** def CalculateStats(self): self.Reset() ! for msg in msginfoDB.db: self.total += 1 m = self.__empty_msg() --- 56,60 ---- def CalculateStats(self): self.Reset() ! for msg in msginfoDB.db.keys(): self.total += 1 m = self.__empty_msg() From anadelonbrin at users.sourceforge.net Sat Feb 14 23:54:02 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sat Feb 14 23:58:07 2004 Subject: [Spambayes-checkins] website faq.txt, 1.60, 1.61 mac.ht, 1.2, 1.3 reply.txt, 1.11, 1.12 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11358 Modified Files: faq.txt mac.ht reply.txt Log Message: Add a FAQ about a semi-serious bug with sb_imapfilter in 1.0a9 (0.9) (released a mere two days ago...). Fix a link on the Mac page (which could really do with some content!). Add a bit in the autoreply pleading with plug-in people to read the troubleshooting guide and include their logs. Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** faq.txt 9 Feb 2004 06:44:41 -0000 1.60 --- faq.txt 15 Feb 2004 04:54:00 -0000 1.61 *************** *** 1229,1232 **** --- 1229,1252 ---- + sb_imapfilter prints out "Skipping unparseable message", but the message vanishes! + ---------------------------------------------------------------------------------- + + This is a known problem with the 1.0a9 (0.9) release, and will be fixed in + the next release. Unless you have something set to expunge/purge the IMAP + folder, the original message will still be there, marked as deleted, so you + can get it back, although malformed messages are most likely to be spam, + anyway. + + If you need a fix for this before the next release, you can get sb_imapfilter.py + from CVS (revision 1.26), and use it instead of the one included with 1.0a9 (0.9). + + Note that in addition to the message disappearing, you'll find a new message + (almost certainly unsure) which is blank, apart from the SpamBayes headers. + You may safely delete these messages. If you are training and come across + one of these messages, you'll also have the ham/spam count in your database + increase, without any tokens increasing their count, but that shouldn't have + any effect, as long as it doesn't happen regularly. + + Development =========== Index: mac.ht =================================================================== RCS file: /cvsroot/spambayes/website/mac.ht,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mac.ht 22 May 2003 02:19:05 -0000 1.2 --- mac.ht 15 Feb 2004 04:54:00 -0000 1.3 *************** *** 6,10 ****

      There is no special support for email programs on Mac OS. The pop3proxy application is known to work on Mac OS X and Mac OS 9. --- 6,10 ----

      There is no special support for email programs on Mac OS. The sb_server application is known to work on Mac OS X and Mac OS 9. Index: reply.txt =================================================================== RCS file: /cvsroot/spambayes/website/reply.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** reply.txt 9 Feb 2004 06:44:42 -0000 1.11 --- reply.txt 15 Feb 2004 04:54:00 -0000 1.12 *************** *** 14,17 **** --- 14,27 ---- http://spambayes.sourceforge.net/faq.html + If you are using the Outlook plug-in, please also take the time to read + the troubleshooting guide - a copy was installed with the plug-in, or + you can read it online: + + http://spambayes.sourceforge.net/docs.html + + Note that you need to include a copy of your log files with any message + asking for help with a problem, or we won't have enough information to + be able to help you. + What is Spambayes? *************** *** 38,42 **** ----------------------------------------------- ! Please ensure that you have the latest version. As of 2004-02-09, this is 1.0a9 for the source, and 0.9 for the binary installer for the Outlook plug-in and sb_server. If you are still having trouble, try looking at the --- 48,52 ---- ----------------------------------------------- ! Please ensure that you have the latest version. As of 2004-02-10, this is 1.0a9 for the source, and 0.9 for the binary installer for the Outlook plug-in and sb_server. If you are still having trouble, try looking at the From anadelonbrin at users.sourceforge.net Sun Feb 15 00:04:39 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sun Feb 15 00:08:45 2004 Subject: [Spambayes-checkins] website windows.ht,1.34,1.35 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12846 Modified Files: windows.ht Log Message: Remove the superscript to a footnote that hasn't been on the page since Jun of last year (!). Index: windows.ht =================================================================== RCS file: /cvsroot/spambayes/website/windows.ht,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** windows.ht 13 Feb 2004 19:18:45 -0000 1.34 --- windows.ht 15 Feb 2004 05:04:37 -0000 1.35 *************** *** 83,86 **** the SpamBayes ! source1, then setup the IMAP filter) for your mail server. --- 83,86 ---- the SpamBayes ! source, then setup the IMAP filter) for your mail server. From anadelonbrin at users.sourceforge.net Sun Feb 15 18:30:52 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sun Feb 15 18:35:05 2004 Subject: [Spambayes-checkins] spambayes/spambayes message.py,1.47,1.48 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22891/spambayes Modified Files: message.py Log Message: as_string is overriding as_string in the parent class, so should have the same parameters, even though we don't really care about them. Index: message.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/message.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** message.py 12 Feb 2004 21:36:14 -0000 1.47 --- message.py 15 Feb 2004 23:30:49 -0000 1.48 *************** *** 269,273 **** return CRLF_RE.sub('\r\n', data) ! def as_string(self): # The email package stores line endings in the "internal" Python # format ('\n'). It is up to whoever transmits that information to --- 269,273 ---- return CRLF_RE.sub('\r\n', data) ! def as_string(self, unixfrom=False): # The email package stores line endings in the "internal" Python # format ('\n'). It is up to whoever transmits that information to *************** *** 275,279 **** # \r\n *only*). imaplib *should* take care of this for us (in the # append function), but does not, so we do it here ! return self._force_CRLF(email.Message.Message.as_string(self)) def modified(self): --- 275,279 ---- # \r\n *only*). imaplib *should* take care of this for us (in the # append function), but does not, so we do it here ! return self._force_CRLF(email.Message.Message.as_string(self, unixfrom)) def modified(self): From anadelonbrin at users.sourceforge.net Sun Feb 15 18:32:40 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sun Feb 15 18:36:53 2004 Subject: [Spambayes-checkins] website faq.txt,1.61,1.62 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23244 Modified Files: faq.txt Log Message: Update to the fix for the problem with imapfilter blanking messages. Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** faq.txt 15 Feb 2004 04:54:00 -0000 1.61 --- faq.txt 15 Feb 2004 23:32:38 -0000 1.62 *************** *** 1240,1243 **** --- 1240,1245 ---- If you need a fix for this before the next release, you can get sb_imapfilter.py from CVS (revision 1.26), and use it instead of the one included with 1.0a9 (0.9). + You should also get message.py (revision 1.46), and replace the message.py + in your Python Lib/site-packages/spambayes folder with it. Note that in addition to the message disappearing, you'll find a new message From anadelonbrin at users.sourceforge.net Sun Feb 15 18:39:43 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sun Feb 15 18:43:56 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_imapfilter.py,1.25,1.26 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24633/scripts Modified Files: sb_imapfilter.py Log Message: Use BODY.PEEK[] instead of RFC822.PEEK, which isn't really valid. Report time taken a little less pedantically. Fix semi-serious problem with handling unparseable messages. What it was doing was printing out an error and then returning from get_substance. This meant that the script kept going, but that the classifying/training was done on an empty message - so when training the ham/spam count would just be incremented and when classifying a blank message (with the sb headers) would be created instead of the malformed one. This now does what sb_server does - if the message is unparseable, then the traceback is written out, and the program keeps going. When it's trained or classified, mboxutils.get_message handily wraps the raw text and ignores the headers. When it's saved out we save it with an exception header. (This isn't *exactly* what sb_server does - it doesn't do any training/classifying - but it's pretty close). Fixes [ 737967 ] Malformed messages break pop3proxy (et al) Index: sb_imapfilter.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_imapfilter.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** sb_imapfilter.py 5 Feb 2004 08:13:26 -0000 1.25 --- sb_imapfilter.py 15 Feb 2004 23:39:40 -0000 1.26 *************** *** 103,110 **** --- 103,116 ---- import getopt import types + import traceback import email import email.Parser from getpass import getpass + from email.Header import Header from email.Utils import parsedate + try: + import cStringIO as StringIO + except ImportError: + import StringIO from spambayes.Options import options, get_pathname_option *************** *** 323,328 **** self.folder = None self.previous_folder = None ! self.rfc822_command = "RFC822.PEEK" self.got_substance = False def setFolder(self, folder): --- 329,335 ---- self.folder = None self.previous_folder = None ! self.rfc822_command = "BODY.PEEK[]" self.got_substance = False + self.invalid = False def setFolder(self, folder): *************** *** 368,375 **** return imap.SelectFolder(self.folder.name) - # We really want to use RFC822.PEEK here, as that doesn't affect - # the status of the message. Unfortunately, it appears that not - # all IMAP servers support this, even though it is in RFC1730 - # Actually, it's not: we should be using BODY.PEEK try: response = imap.uid("FETCH", self.uid, self.rfc822_command) --- 375,378 ---- *************** *** 389,403 **** new_msg = email.Parser.Parser().parsestr(data["RFC822"]) except email.Errors.MessageParseError, e: ! print 'Skipping unparseable message: %s' % e ! return ! self._headers = new_msg._headers ! self._unixfrom = new_msg._unixfrom ! self._payload = new_msg._payload ! self._charset = new_msg._charset ! self.preamble = new_msg.preamble ! self.epilogue = new_msg.epilogue ! self._default_type = new_msg._default_type ! if not self.has_key(options["Headers", "mailid_header_name"]): ! self[options["Headers", "mailid_header_name"]] = self.id self.got_substance = True if options["globals", "verbose"]: --- 392,441 ---- new_msg = email.Parser.Parser().parsestr(data["RFC822"]) except email.Errors.MessageParseError, e: ! # Yikes! Barry set this to return at this point, which ! # would work ok for training (IIRC, that's all he's ! # using it for), but for filtering, what happens is that ! # the message ends up blank, but ok, so the original is ! # flagged to be deleted, and a new (almost certainly ! # unsure) message, *with only the spambayes headers* is ! # created. The nice solution is still to do what sb_server ! # does and have a X-Spambayes-Exception header with the ! # exception data and then the original message. ! self.invalid = True ! ! # This is nicked from sb_server - thanks Richie! ! stream = StringIO.StringIO() ! traceback.print_exc(None, stream) ! details = stream.getvalue() ! ! # Build the header. This will strip leading whitespace from ! # the lines, so we add a leading dot to maintain indentation. ! detailLines = details.strip().split('\n') ! dottedDetails = '\n.'.join(detailLines) ! headerName = 'X-Spambayes-Exception' ! header = Header(dottedDetails, header_name=headerName) ! ! # Insert the header, converting email.Header's '\n' line ! # breaks to IMAP4's '\r\n'. ! # (Also insert the id header, otherwise we'll keep doing ! # this message over and over again). ! headers, body = re.split(r'\n\r?\n', data["RFC822"], 1) ! header = re.sub(r'\r?\n', '\r\n', str(header)) ! headers += "\n%s: %s\r\n%s: %s\r\n\r\n" % \ ! (headerName, header, ! options["Headers", "mailid_header_name"], self.id) ! self.invalid_content = headers + body ! ! # Print the exception and a traceback. ! print >>sys.stderr, details ! else: ! self._headers = new_msg._headers ! self._unixfrom = new_msg._unixfrom ! self._payload = new_msg._payload ! self._charset = new_msg._charset ! self.preamble = new_msg.preamble ! self.epilogue = new_msg.epilogue ! self._default_type = new_msg._default_type ! if not self.has_key(options["Headers", "mailid_header_name"]): ! self[options["Headers", "mailid_header_name"]] = self.id self.got_substance = True if options["globals", "verbose"]: *************** *** 411,414 **** --- 449,461 ---- self.folder = dest + def as_string(self, unixfrom=False): + # Basically the same as the parent class's except that we handle + # the case where the data was unparsable, so we haven't done any + # filtering, and we are not actually a proper email.Message object. + if self.invalid: + return self._force_CRLF(self.invalid_content) + else: + return message.SBHeaderMessage.as_string(self, unixfrom) + def Save(self): '''Save message to imap server.''' *************** *** 697,701 **** if options["globals", "verbose"]: ! print "Training took %s seconds, %s messages were trained" \ % (time.time() - t, total_ham_trained + total_spam_trained) --- 744,748 ---- if options["globals", "verbose"]: ! print "Training took %.4f seconds, %s messages were trained" \ % (time.time() - t, total_ham_trained + total_spam_trained) *************** *** 725,729 **** print "\nClassified %s ham, %s spam, and %s unsure." % \ (count["ham"], count["spam"], count["unsure"]) ! print "Classifying took", time.time() - t, "seconds." --- 772,776 ---- print "\nClassified %s ham, %s spam, and %s unsure." % \ (count["ham"], count["spam"], count["unsure"]) ! print "Classifying took %.4f seconds." % (time.time() - t,) From anadelonbrin at users.sourceforge.net Mon Feb 16 03:14:49 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Feb 16 03:19:06 2004 Subject: [Spambayes-checkins] spambayes/pspam .cvsignore,NONE,1.1 Message-ID: Update of /cvsroot/spambayes/spambayes/pspam In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11334/pspam Added Files: .cvsignore Log Message: Ignore autogenerated. --- NEW FILE: .cvsignore --- *.py[co] From anadelonbrin at users.sourceforge.net Mon Feb 16 03:14:50 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Feb 16 03:19:07 2004 Subject: [Spambayes-checkins] spambayes/pspam/pspam .cvsignore,NONE,1.1 Message-ID: Update of /cvsroot/spambayes/spambayes/pspam/pspam In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11334/pspam/pspam Added Files: .cvsignore Log Message: Ignore autogenerated. --- NEW FILE: .cvsignore --- *.py[co] From anadelonbrin at users.sourceforge.net Mon Feb 16 03:16:57 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Feb 16 03:21:13 2004 Subject: [Spambayes-checkins] spambayes/windows spambayes.iss,1.9,1.10 Message-ID: Update of /cvsroot/spambayes/spambayes/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11667/windows Modified Files: spambayes.iss Log Message: Damn - I was sure that I did this before, and I really wanted this in 0.9. Oh well. Include a binary for pop3dnd in the installer, since it works now, so that I can suggest that people try it out when they ask about training on the list (to get it tested a bit wider, before it's available as an install option). Index: spambayes.iss =================================================================== RCS file: /cvsroot/spambayes/spambayes/windows/spambayes.iss,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** spambayes.iss 9 Feb 2004 22:44:58 -0000 1.9 --- spambayes.iss 16 Feb 2004 08:16:39 -0000 1.10 *************** *** 29,32 **** --- 29,33 ---- Source: "py2exe\dist\bin\sb_server.exe"; DestDir: "{app}\bin"; Check: InstallingProxy; Flags: ignoreversion + Source: "py2exe\dist\bin\sb_pop3dnd.exe"; DestDir: "{app}\bin"; Check: InstallingProxy; Flags: ignoreversion Source: "py2exe\dist\bin\sb_tray.exe"; DestDir: "{app}\bin"; Check: InstallingProxy; Flags: ignoreversion Source: "py2exe\dist\bin\sb_upload.exe"; DestDir: "{app}\bin"; Check: InstallingProxy; Flags: ignoreversion From anadelonbrin at users.sourceforge.net Mon Feb 16 03:20:20 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Feb 16 03:24:37 2004 Subject: [Spambayes-checkins] spambayes/windows/py2exe setup_all.py, 1.15, 1.16 Message-ID: Update of /cvsroot/spambayes/spambayes/windows/py2exe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12304/windows/py2exe Modified Files: setup_all.py Log Message: Build pop3dnd as well. It should work fine, and provide a simpler training method, so it'd be nice to have some people try it out. Index: setup_all.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/windows/py2exe/setup_all.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** setup_all.py 8 Jan 2004 20:41:18 -0000 1.15 --- setup_all.py 16 Feb 2004 08:20:17 -0000 1.16 *************** *** 99,102 **** --- 99,106 ---- script = os.path.join(sb_top_dir, "scripts", "sb_server.py") ) + sb_pop3dnd = dict( + dest_base = "bin/sb_pop3dnd", + script = os.path.join(sb_top_dir, "scripts", "sb_pop3dnd.py") + ) sb_upload = dict( dest_base = "bin/sb_upload", *************** *** 146,150 **** service=[service], # console exes for debugging ! console=[sb_server, sb_upload, outlook_dump_props], # The taskbar windows=[pop3proxy_tray, outlook_addin_register, autoconfigure], --- 150,154 ---- service=[service], # console exes for debugging ! console=[sb_server, sb_upload, outlook_dump_props, sb_pop3dnd], # The taskbar windows=[pop3proxy_tray, outlook_addin_register, autoconfigure], From anadelonbrin at users.sourceforge.net Mon Feb 16 03:59:17 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Feb 16 04:03:33 2004 Subject: [Spambayes-checkins] spambayes/spambayes smtpproxy.py,1.5,1.6 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19526/spambayes Modified Files: smtpproxy.py Log Message: Fix a NameError reported on the list. Index: smtpproxy.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/smtpproxy.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** smtpproxy.py 16 Dec 2003 05:06:34 -0000 1.5 --- smtpproxy.py 16 Feb 2004 08:59:14 -0000 1.6 *************** *** 359,363 **** def extractSpambayesID(self, data): ! msg = message_from_string(data) # The nicest MUA is one that forwards the header intact. --- 359,363 ---- def extractSpambayesID(self, data): ! msg = sbheadermessage_from_string(data) # The nicest MUA is one that forwards the header intact. From anadelonbrin at users.sourceforge.net Mon Feb 16 04:01:02 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Feb 16 04:05:18 2004 Subject: [Spambayes-checkins] spambayes/spambayes UserInterface.py, 1.43, 1.44 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19816/spambayes Modified Files: UserInterface.py Log Message: When sending an autogenerated bug report, the wrapping was normalising all newlines to a space, which made for ugly messages. Fix that so that it wraps each paragraph, and leaves the newlines where they are. Index: UserInterface.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/UserInterface.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** UserInterface.py 5 Feb 2004 09:40:30 -0000 1.43 --- UserInterface.py 16 Feb 2004 09:00:58 -0000 1.44 *************** *** 1189,1209 **** """Wrap the text into lines no bigger than the specified width.""" try: ! from textwrap import wrap except ImportError: pass else: ! return '\n'.join(wrap(text, width)) # No textwrap module, so do the same stuff (more-or-less) ourselves. ! wordsep_re = re.compile(r'(\s+|' # any whitespace ! r'-*\w{2,}-(?=\w{2,})|' # hyphenated words ! r'(?<=\S)-{2,}(?=\w))') # em-dash ! if len(text) <= width: ! return [text] ! chunks = wordsep_re.split(text) ! chunks = filter(None, chunks) ! return '\n'.join(self._wrap_chunks(chunks, width)) def _wrap_chunks(self, chunks, width): ! """Stolen from textwrap; see that module in Python > 2.3 for details.""" lines = [] --- 1189,1212 ---- """Wrap the text into lines no bigger than the specified width.""" try: ! from textwrap import fill except ImportError: pass else: ! return "\n".join([fill(paragraph, width) \ ! for paragraph in text.split('\n')]) # No textwrap module, so do the same stuff (more-or-less) ourselves. ! def fill(text, width): ! if len(text) <= width: ! return text ! wordsep_re = re.compile(r'(-*\w{2,}-(?=\w{2,})|' # hyphenated words ! r'(?<=\S)-{2,}(?=\w))') # em-dash ! chunks = wordsep_re.split(text) ! chunks = filter(None, chunks) ! return '\n'.join(self._wrap_chunks(chunks, width)) ! return "\n".join([fill(paragraph, width) \ ! for paragraph in text.split('\n')]) def _wrap_chunks(self, chunks, width): ! """Stolen from textwrap; see that module in Python >= 2.3 for details.""" lines = [] From anadelonbrin at users.sourceforge.net Mon Feb 16 18:30:05 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Feb 16 18:34:28 2004 Subject: [Spambayes-checkins] spambayes/windows readme_proxy.html, 1.5, 1.6 spambayes.iss, 1.10, 1.11 Message-ID: Update of /cvsroot/spambayes/spambayes/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2208/windows Modified Files: readme_proxy.html spambayes.iss Log Message: Opps. We built the service, but never installed it. The documentation was also a bit out of date, referring to a non-existant directory, and to the old name for the binary. Index: readme_proxy.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/windows/readme_proxy.html,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** readme_proxy.html 29 Dec 2003 03:21:39 -0000 1.5 --- readme_proxy.html 16 Feb 2004 23:30:02 -0000 1.6 *************** *** 94,100 ****

      • Open a command prompt, and change to the \Program Files\SpamBayes\proxy directory.
      • !
      • Execute pop3proxy_service.exe -install
      • Select Control --- 94,100 ----
        • Open a command prompt, and change to the \Program Files\SpamBayes\bin directory.
        • !
        • Execute sb_service.exe -install
        • Select Control *************** *** 110,114 ****
        • Start the SpamBayes Tray Icon program, and confirm the server is running. Configure and manage ! spambayes normally.
        --- 110,114 ----
      • Start the SpamBayes Tray Icon program, and confirm the server is running. Configure and manage ! SpamBayes normally.
      Index: spambayes.iss =================================================================== RCS file: /cvsroot/spambayes/spambayes/windows/spambayes.iss,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** spambayes.iss 16 Feb 2004 08:16:39 -0000 1.10 --- spambayes.iss 16 Feb 2004 23:30:02 -0000 1.11 *************** *** 29,32 **** --- 29,33 ---- Source: "py2exe\dist\bin\sb_server.exe"; DestDir: "{app}\bin"; Check: InstallingProxy; Flags: ignoreversion + Source: "py2exe\dist\bin\sb_service.exe"; DestDir: "{app}\bin"; Check: InstallingProxy; Flags: ignoreversion Source: "py2exe\dist\bin\sb_pop3dnd.exe"; DestDir: "{app}\bin"; Check: InstallingProxy; Flags: ignoreversion Source: "py2exe\dist\bin\sb_tray.exe"; DestDir: "{app}\bin"; Check: InstallingProxy; Flags: ignoreversion From anadelonbrin at users.sourceforge.net Mon Feb 16 18:36:47 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Feb 16 18:41:10 2004 Subject: [Spambayes-checkins] website faq.txt,1.62,1.63 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3388 Modified Files: faq.txt Log Message: Add a note for anyone looking for the service installer in the 1.0a9 (0.9) binary. Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** faq.txt 15 Feb 2004 23:32:38 -0000 1.62 --- faq.txt 16 Feb 2004 23:36:37 -0000 1.63 *************** *** 1251,1254 **** --- 1251,1269 ---- + The 1.0a9 (0.9) installer is missing the pop3proxy_service file. + ---------------------------------------------------------------- + + There are two bugs here - one is that the readme_proxy.html file installed + by the 1.0a9 (0.9) installer talks about a directory that doesn't exist, + namely {Program Files}/SpamBayes/Proxy. This should be {Program Files}/SpamBayes/bin, + but that won't help you, because the executable that you need to install + the service isn't installed. + + This will be fixed in the next release (in the 'bin' directory will be a + file called "sb_server.exe"). Until then, if you want to install sb_server + as a service, you will need to do this from source. You can, of course, + run sb_server.exe or sb_tray.exe, without having the service installed. + + Development =========== From anadelonbrin at users.sourceforge.net Mon Feb 16 23:38:21 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Mon Feb 16 23:42:46 2004 Subject: [Spambayes-checkins] spambayes/scripts sb_imapfilter.py,1.26,1.27 Message-ID: Update of /cvsroot/spambayes/spambayes/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25932/scripts Modified Files: sb_imapfilter.py Log Message: Simplify a conditional statement (if the first test was True, then the second would be True, if the first test was False, then the second would be False, so the second one isn't necessary). Add [ 848311 ] sb_imapfilter.py obeys launch_browser Index: sb_imapfilter.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/scripts/sb_imapfilter.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** sb_imapfilter.py 15 Feb 2004 23:39:40 -0000 1.26 --- sb_imapfilter.py 17 Feb 2004 04:38:18 -0000 1.27 *************** *** 18,22 **** -t : train contents of spam folder and ham folder -c : classify inbox ! -h : help -v : verbose mode -P : security option to prompt for imap password, --- 18,22 ---- -t : train contents of spam folder and ham folder -c : classify inbox ! -h : display this message -v : verbose mode -P : security option to prompt for imap password, *************** *** 27,30 **** --- 27,33 ---- -l minutes : period of time between filtering operations -b : Launch a web browser showing the user interface. + (If not specified, and neither the -c or -t + options are used, then this will default to the + value in your configuration file). -o section:option:value : set [section, option] in the options database *************** *** 873,877 **** # Web interface ! if not (doClassify or doTrain) or launchUI: if server != "": imap = IMAPSession(server, port, imapDebug, doExpunge) --- 876,880 ---- # Web interface ! if not (doClassify or doTrain): if server != "": imap = IMAPSession(server, port, imapDebug, doExpunge) *************** *** 879,883 **** httpServer.register(IMAPUserInterface(classifier, imap, pwd, IMAPSession)) ! Dibbler.run(launchBrowser=launchUI) else: while True: --- 882,887 ---- httpServer.register(IMAPUserInterface(classifier, imap, pwd, IMAPSession)) ! Dibbler.run(launchBrowser=launchUI or options["html_ui", ! "launch_browser"]) else: while True: From anadelonbrin at users.sourceforge.net Thu Feb 19 17:44:06 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Thu Feb 19 17:48:58 2004 Subject: [Spambayes-checkins] website faq.txt,1.63,1.64 Message-ID: Update of /cvsroot/spambayes/website In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19477 Modified Files: faq.txt Log Message: Correct the likely location of the plug-in's data directory with WinNT, thanks to Bob Coe. Index: faq.txt =================================================================== RCS file: /cvsroot/spambayes/website/faq.txt,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** faq.txt 16 Feb 2004 23:36:37 -0000 1.63 --- faq.txt 19 Feb 2004 22:44:03 -0000 1.64 *************** *** 509,516 **** using the `Show Data Folder` button on the `Advanced` tab of the main `SpamBayes` manager dialog. If you need to locate it by hand, on Windows ! NT/2000/XP, it will probably be: C:\\Documents and Settings\\[username]\\Application Data\\Spambayes On other versions of Windows, it will probably be: --- 509,520 ---- using the `Show Data Folder` button on the `Advanced` tab of the main `SpamBayes` manager dialog. If you need to locate it by hand, on Windows ! 2000/XP, it will probably be: C:\\Documents and Settings\\[username]\\Application Data\\Spambayes + With Windows NT, it will probably be: + + C:\\WinNT\\profiles\\[username]\\Application Data + On other versions of Windows, it will probably be: From anadelonbrin at users.sourceforge.net Sat Feb 21 21:31:21 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sat Feb 21 21:36:35 2004 Subject: [Spambayes-checkins] spambayes/spambayes UserInterface.py, 1.44, 1.45 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5361/spambayes Modified Files: UserInterface.py Log Message: It's too hard to keep track of messages if they all have a "Problem with POP3 Proxy" subject, so get the user to customize it a bit. Remove the "to" and "cc" fields, and handle these for the user. Index: UserInterface.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/UserInterface.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** UserInterface.py 16 Feb 2004 09:00:58 -0000 1.44 --- UserInterface.py 22 Feb 2004 02:31:18 -0000 1.45 *************** *** 1051,1056 **** domain_guess = domain_guess[len(pre):] report.from_addr.value = "[YOUR EMAIL ADDRESS]@%s" % (domain_guess,) ! report.cc_addr.value = report.from_addr.value ! report.subject.value = "Problem with %s" % (self.app_for_version,) # If the user has a log file, attach it. try: --- 1051,1056 ---- domain_guess = domain_guess[len(pre):] report.from_addr.value = "[YOUR EMAIL ADDRESS]@%s" % (domain_guess,) ! report.subject.value = "Problem with %s: [PROBLEM SUMMARY]" % \ ! (self.app_for_version,) # If the user has a log file, attach it. try: *************** *** 1094,1099 **** self._writePostamble() ! def onSubmitreport(self, from_addr, to_addr, cc_addr, message, ! subject, attach): """Send the help message/bug report to the specified address.""" # For guessing MIME type based on file name extension --- 1094,1098 ---- self._writePostamble() ! def onSubmitreport(self, from_addr, message, subject, attach): """Send the help message/bug report to the specified address.""" # For guessing MIME type based on file name extension *************** *** 1107,1111 **** from email.MIMEText import MIMEText ! if not self._verifyEnteredDetails(from_addr, cc_addr, message): self._writePreamble("Error", ("help", "Help")) self.write(self._buildBox("Error", "status.gif", --- 1106,1110 ---- from email.MIMEText import MIMEText ! if not self._verifyEnteredDetails(from_addr, subject, message): self._writePreamble("Error", ("help", "Help")) self.write(self._buildBox("Error", "status.gif", *************** *** 1120,1126 **** outer = MIMEMultipart() outer['Subject'] = subject ! outer['To'] = to_addr ! if cc_addr: ! outer['CC'] = cc_addr outer['From'] = from_addr outer.preamble = self._wrap(message) --- 1119,1128 ---- outer = MIMEMultipart() outer['Subject'] = subject ! # Force the message to "spambayes@python.org", rather than ! # letting the user choose. ! outer['To'] = '"SpamBayes Mailing List" ' ! # Always cc the user, so that they get a copy of the message, ! # even if they're not subscribed to the list. ! outer['CC'] = from_addr outer['From'] = from_addr outer.preamble = self._wrap(message) *************** *** 1168,1172 **** recips = [] ! for r in [to_addr, cc_addr]: if r: recips.append(r) --- 1170,1177 ---- recips = [] ! # If you are testing, then make sure you change this ! # address to something else, so that you don't bombard the ! # list with messages. ! for r in ["spambayes@python.org", from_addr]: if r: recips.append(r) *************** *** 1176,1187 **** self._writePostamble() ! def _verifyEnteredDetails(self, from_addr, cc_addr, message): """Ensure that the user didn't just send the form message, and at least changed the fields.""" ! if from_addr.startswith("[YOUR EMAIL ADDRESS]") or \ ! cc_addr.startswith("[YOUR EMAIL ADDRESS]"): return False if message.endswith("[DESCRIBE YOUR PROBLEM HERE]"): return False return True --- 1181,1193 ---- self._writePostamble() ! def _verifyEnteredDetails(self, from_addr, subject, message): """Ensure that the user didn't just send the form message, and at least changed the fields.""" ! if from_addr.startswith("[YOUR EMAIL ADDRESS]"): return False if message.endswith("[DESCRIBE YOUR PROBLEM HERE]"): return False + if subject.endswith("[PROBLEM SUMMARY]"): + return False return True From anadelonbrin at users.sourceforge.net Sat Feb 21 21:31:21 2004 From: anadelonbrin at users.sourceforge.net (Tony Meyer) Date: Sat Feb 21 21:36:37 2004 Subject: [Spambayes-checkins] spambayes/spambayes/resources ui.html, 1.31, 1.32 ui_html.py, 1.30, 1.31 Message-ID: Update of /cvsroot/spambayes/spambayes/spambayes/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5361/spambayes/resources Modified Files: ui.html ui_html.py Log Message: It's too hard to keep track of messages if they all have a "Problem with POP3 Proxy" subject, so get the user to customize it a bit. Remove the "to" and "cc" fields, and handle these for the user. Index: ui.html =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/resources/ui.html,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ui.html 5 Feb 2004 09:33:03 -0000 1.31 --- ui.html 22 Feb 2004 02:31:18 -0000 1.32 *************** *** 164,175 **** - To: - - - CC: - - Subject: ! Message: --- 164,169 ---- Subject: ! Message: Index: ui_html.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/resources/ui_html.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ui_html.py 5 Feb 2004 09:33:03 -0000 1.30 --- ui_html.py 22 Feb 2004 02:31:18 -0000 1.31 *************** *** 6,121 **** import zlib ! data = zlib.decompress("x=ksFSCVN2fcN=;YMmR*\0163\025ͰIfs\017@?|\ ! CVvG7\032@\003h\000f.x\037ްwO޽b^o0j0x=y^l\007\ ! XA2\030\033ŢX&\007\021-\",.=7Y\006k.OmZ|\026b@\015ϒ\ ! \027\001[\024E㿕w\025\013P@㴸R\013գAg7\017Ys,#\00685H7_\015p8\ ! 'а+c#,e}QP\003x%\013\033d&\"Z\014 7g, 9br\025K\ ! y\026<@NΘ:uϼFK\036\036@\016\007=0 \035ӒuJ\ ! dղ[`uJ@t\032m\003t\024y[\0111O7,k0z]s2|vnMϻv10b\ ! m'\\\022\023xGϐ\027Q|$W\032\033\036`\033yx9g2\017/}?g>\0035O/`\ ! *q\024%\037L2;\007<\000B\015\036H͂\031>X\014\037ȩ'#0\025KSEg0\020\ ! k}1\010\003]Ki/9+>.;u70Q\034X\006qz\024zZ\025/\026gh0g\ ! j\002d\021K6\0230\027bAwG,8\005&\024\013\022!zA\032f'\012ћ\022\0279\037*A\000W\026TAbd\007\005سX\005e\032 #k\022\001\ ! \024៮U\000ZCּB\023\016H\025\030\006; W\015\006#K$\034\"\"\030Ĕ*s\ ! `RZ\004% 'pIfx M'`-ub\026\020\007Nl\030睖\\\021\023)ˌ\ ! :|ޘ\025ZW\007'\017ӯ=#M^,I\002=C\014zf\025\002P\003\016zڃC_'\ ! BЌ\014\021\026\001\026D?\006Aq}\010\012!\033U\000\002\027\017L\003W,\035φ\ ! >,cҵ9\035\027\017tn5@AW \014\027I0\036ཐE%#\005S\0010\034p\0174\011UȤ\ ! Ī>֎\001\032;t\025\004\004\002\022X\0370\0112\023\010PV4i惦߻Sn\014\ ! \010\0112LFvoӥv\001\027\03253_{\015O7\011\037+8~MXON*a==_X\021Za\ ! \021\013u(GAf2ad|PKr\012yNӈ*(P!\014*\01720tĬ2\020)*-m0Y\ ! \000\011\023T9:}g\033yH\036\011,\012LĿ\023s8}=ΆҀ`}a\011(ʑ=\010\ ! \007bm±\026j\036\"z\024B\0276J\030\02694Nj\001̛.*iSd凈\023\ ! 1\031Uw\0252f\036a{熞m[|XO'ɯ\017?~8e\000UR$a\033?$o(\ ! :Mr1 =\016H黅\023̰,\035`|V\031\022D\004Y<\024)$\027V:\011w:\ ! ހbko\030=kB\024AhVRC_*\011g1:GK\014H\032\0032\\\030w\ ! nZ\023E\032n%=l\0229A~hFbĊ\015J\020Qc\014ļ\016edPkv`%\ ! \022ƾy}+ܪ \032.\013`r@F\0377\016c\013\015@f|[\037`Q?T{\005Ita\ ! yӬcuV\000npu\037*?aCV\020.=/~p\\\022t5pM㊿LY7}L\032\ ! 9̜ (ĺUd\036L\035CTCD\036R_8N7!hךˊW߸!t\ ! \006I\004Bw*6\015`1,ƌ(fIA5B9\002\021.\020[\012i'G?Hm{x\ ! ld;EPdZ^j@\\&VpK:1\021Ti\026K.T\031ZPeF\014\011/O\ ! \000^`&El]\005͟ d\037\023b\005|s\037\004E3FuE9)\026m&t#\\\010h\ ! :e\030\021\0330\016.o\024\002fʿ\000fHT{Dg]\014ٺq\006A\016 q\001\ ! 6kx6h\016tMù0n\036\010߿8uE\034E\034XNNOy\012#1!\002 \005\ ! RUgwi\016՜8sߙj0~]\015\003\032\014\025͖UP?\032\017/QJ\026\005KGD\000ıS\ ! Vs&9\007\013m$]\030|͞<\036r}?%xZi\035Z*\024qf°e>PO\ ! `p/W_N^k\017TH;T\\5+W3v\020c\037/YI?\034\ ! %;9^\"ie/ǿ\030\032\016Y.\036\000\036χ濷JfIL%\000\004{\022\ ! Ӌ\003\037v\"\"\005\017k[L̘zr_wb+X\016\016\017۽\016\ ! *i\030?/y\007\015?rn3\030k\017M²5\0377#Nߤ9UxVYkl]xSNja\ ! \024(tE0dx0b\0372v\003d;]c\007rgerB=,V,\027\027};C\"\0208bgd8\027\035OZy\014F\012\013\031i)\035Oe\ ! 7,c#D\010I}[\032ṉ\015= d\035-!UISw\033f3\012rʝ2KD\ ! \0203\000\021γ/q&~5Oqe\0241\0266\021V((\0022Zf-0\026v\005#\ ! \010*>h.[$\032\021\033~kN3\033?T)Z JäJ*\037RZh֩MJ5\022\ ! -yj?Ug>p6\027U[]BAWu@oU6#]oVinWm\005HM\ ! \011\036`TO<\034\017ߔ8w*\035142\014mlu)|)鬘=tws%\ ! KU*ؗ6fg\037ˏ[\026\015n\002\004\031Nu%N~Wn0\032\ ! [/]H\002֑->aNnE,Vԋ\0065jd-\036\031@ơXtNG`LՅ+\ ! F\000Ŕ!Q\034m%X\"ٯ\022SuV<\002~\004SxWxô\\t\033M=bD\ ! 7jӮI1MhSxZhF5d?Ҝ\0262F\032\020ϱƖys\017ɤ‚\ ! R\030HS;,ŵgn\022lXH;\014o\021DZx\016\014C,L?Y@0:,\ ! ÚeD:sV\033\007Iy@\002\0326\006\001zk;\015}vE|kl7{\ ! 5:\035 sq=>i0FpJ\034yMk}\011߾nǨ[\020h~2m*lO6\ ! ݔ\027$NODj&(BE\025Wo\"@~ѱ\036\021m)ۀZݚ^>f5\031\024[\ ! x;u269PuvF³GW;ij[3N÷{81J?x\0101\ ! l\033΍J |\027\022+ȏON7\024`U\026!-,/6\000@\007$.T\015Bu\000ݞ\003Bz<\005\"hB\ ! &xB\033\017_}͆\001;>5B‡\021o[N\011\"\012$t΁\\UA\001E.gy}ӑ\ ! \013ɳV2ǀ\023S'\002~2\014g u$hrlw[\0200flwn\025^_\011>}\026\ ! AQJS:&lhlfv7\0329;TU3n\014u\030dG\004NWf4/\033.t)L+(e\003{B-\\Gt|J\031\000\015D%|\010Te,=(H[\000\032'¥BEcڨ3\ ! \002*\006\031?Lt-\020\024\036\006G5ge\007\037\017QW8mJt\034|t{\ ! \013z\\sc&t{[)a\035w|}\0218\017sR/tk' _ނx\014\ ! `\012%`jgsQF\000\0350\004sȱAT6>\023HP{&݁/\\~윭cjS\0371q\ ! &\023~=4Qj\022,;&xu&n\021{U%(&Tj\003߹\024p.l\ ! 9S!1kLUxx9 ̀Y3\001D2}\012.a9>\026s79ڴH7lC3\ ! GV:D\002nU`\020ULA{Q&[55POp8cb\ ! @kk+R\"\002qIJnQJ\005epϽ*?avZ)s}O#>\013T&\ ! C]ߍG\020N:(؈D*UfB\026٫UG-v y|j\024d \ ! \0372Ǹ\025$\021VO@3'#X_^.\"\022kGEjPu\0319{!Ш\036=\015\014\ ! \020x\"nHЅv͊1\034>몼ot~\\R7ub\030WvT`̯g\ ! \033??\034G}\030^\027\020\004I\024(dCv|6\032NO4D#o\027VU&\015\003\007\021o\ ! _b`N#hx=\032OY㫩Hh]\"T7qe \\/]zJ\ ! ^̌ق\022N\007)a\016\0072و}9^}\004\ ! '\015o\027\036&z|x6]_q\\o%\002p8\026Xȭ&\011c]ʓ\006n2\ ! \011a`(`s03{ً\014`\034?;3f2\013E+d\012\007K\0176\001fW,\012l5%Q\ ! n\011!9-\032\025ыs>\027j\012dh\003_P)>3ꛋ\000u̵E˯9[\ ! Ea\0009x\030\003&\017g\031\027\016D\\\031Sk\0010}Г\016\012\003ҡ8N\011\035\014\ ! Zv\013n\\\026Nm\"Rq+\02355\000\015\032u\014[_\023n]\014\030h\011\ ! D4x3dE\030ݳ y~+\015M\036`\033yh9gy\026\\I\036|\006\006k\\|/\ ! 0?\030?Myz\016x\000\0324=\0053P}4a\031\024e$'#?Wʥ)\"\0233\030\010\ ! 5{1Á%4yqʨN\035\0150Lq\0249 ?\"vO\005\020b\0016Dc\007p5\027ԕ\027\010\025&\ ! /Ә0Yȕw%;ZaR#*|\005X(\000\013P4L_i\025,H\033&\036+֩\000o\015\ ! \003Ka_{\014ڥw<\006Z9c09[aV%B0m/PB6QJI\017Y{{>K\ ! \015qׂg\035sw*|\032zc\030\0339ˬp\010۳\037>d2\025Ɂmwļ\016a\035\ ! ថB\031\000\012>)0W\";@I30+\010_ͮӸ8~;\004avb\020'OЀ\ ! Fj\010C\014\012M\006 gC$֪:Ev`-\"߰f倻\023__0qS\ ! \011\013D\034C\000\036YE6\000'Ԁ^~З\011P\ ! 44#_E\000\005я@\020`\\\0375B\006|?}\025\000\005*\003'\000󕻙\027(sngC\037\ ! 1t|x:hrzW$s\030\017ZNE˕\033G\012\003ʟp=$T\005#\023\ ! 6[;\"\007h\026UD\023%,uaư>\"a\027\033\023d&\020AY4k}\015~NE2 $\ ! H2\031ٵ1\027.\005\016ШkxIx_qkzrR\011Š\012]Tod\ ! P\\ȯC9ɚ\010Y\024<3Y\015%\030\025s8=M&\006$Vi9\004zH{3#gp\012\ ! \0271\\|\006:\012P)t*WC9\030\034v\014%@O)FP\001XW)\003XA\0030e\025\ ! \037{1E\005\021\001d%\016<\011PXN1@*\017\0048\030:$cp\0056^\000Z\034Yk3\ ! \020e(\013\014\021,6lP\036;\001\000/[A q'jk04\025\0347\012\022XZ\033\036\ ! \014E\030jrD.W~)\010\032x\001\030e@t\011\030U\0378q\037q\020\004\024{-\035\015\0069P\020\010`\\\ ! \023Q\0140\023蜧 <Ϗ\032x5.b\027FYXbC\010ˍ\017\000\020\012\003Xr\ ! \024\035! #\0032\0052_3\005\000f|TScL\000}VTf#\001:0sh3|\027L\ ! 3f%t>:F3\020%U\006\035&\021\003M!13]\002\002K\014F=8O9i$^,z +\025%\ ! \006\023L\005F+\023v+`$\0036\000v:Tl\000I=\010\026i\024\014طj\037,Id\005\ ! $b)\012Z\033\011\023L$52\\a\005Fɹd+x\007?E]EP\005K3x~9MK\034ݡbzO\ ! V\005X~\017I\"m_X_?\003\031\\\036---~ůJpچA\022'@إt\\PN\ ! ߽tE)F\001yB\004t\031C)\004\030+X@Uj%\011A\024I\025.=\ ! %^\012i\002ӡ\015\012[\026-y?ߞ\016=>y,,\003FI(\036.^MZMc\002\ ! \0300\012.\00427n/dJ:\007S[\026{\030`0#n\007\036\033MkUs\023we\ ! jLRE!\013Ö=WO`pW^L^DL;T'[\0045\023UD3v\ ! \020ʠW\037ӧ\037d\016A\034V]s_[A\004\015,b\027M\017\000\017\ ! zSqD%v\000\004{\034ǙӋ\003\037vi\"\"\005\017k[L̘zr\ ! _ȷr%+X\016\016\017۽\016*i\030?+E\007\015?rn\031\014~\007%a\032f⏛\021ol\ ! *v|5P6ͫF)f5ް_\007NI\"\0303,\037m̪#n@NAV\031\017us\ ! ݪl\005\003tB\012(6\016Q\0246mؗF\014z55]8q|iy\ ! 8Q\037\025>މFf'e`o\021pgUFpT:\037?\002Hy1`\006&_qq\"Xx\011\ ! \"8\011P\027#0x%\017*\022\033H\002\"1d\026S?Unл\013\033\ ! \0174y\027]\024)6\036bIs?D\"\022:JB0Xtѓ\007}\011),2tL.ք\ ! Aڄ56H>m\0055id6#FNe2{54Y[\004b̋#v|nD\ ! NSvhx::>(\012[(-\007bE8Avj'\021ԈS]kv\002'!biA9B6\017\004aV\022\ ! %U\025B#NnRhS<ԁv*͕\004*\022\012*\013\005z7J-\036\ ! \011z+Jwm+pF\"mJ\0003zIx&ƹSՈ\031|'\011dhc礮M\011VU\ ! ,\023KyOg쁙ý\023+]lzU\001\0374C<^\012l\035gϞw#\024 0\ ! p\032+v\033$Ouz2=F\022i)A\002sr(tf=զ^x5a#mH<\012\0145\ ! [Ưw:\007c.|^4\004\007-\014)&b砿\017\022*1e|]c#1\ ! \033\033\025hi\0268TQvMiRgFӺF3!'}єfb.\036I\\\032iHC\0071\ ! \032O\001qGI\005\037fw\036Yk\024$ذvz\031#\034\031xC\ ! ,L?Y@0:,ÚeD:sV\033\007Iy@\002\0326\006\001ze;\015}v\ ! E|k824a͢N7gt.ǧ;M\026P\035B)wm\033۽]3UW\030u\ ! \013\"HͯWmQ\0361x\034\004N([\004Q*{&?\004jˌhK\006\ ! ֬eB6ɨOUS'.\017l\003Ugoh$<\033|$}9S4|{:7X\ ! ӽo_\033}G\\p+\032\026ܨ\004w,tC\001V\005j\031\002:{|\003t\000%bO\ ! .P\0079\024\007\021A\023B6\021jYo<7\033\006\005\011\037F5n9%rR+9\007zs+W\021\007\ ! \021\007H\026L$&MG2.$OZ\034\003K2\010a83\005#ACc*1\026NJ\ ! P'+\022},l\017揕tL.n4r*w|%fg<\031\0101\026\ ! \011h~\024\007`=\004g&R\001|h^:nc]9\026Mgw0\015\011`s\036\035e\000\ ! $\013=={8jYIM-;/M\011:J㎍\015b\025\\M~7\023:\004\007\034[?\002\ ! lsn(\003o1\0036\026\022^Ϣ\033qov;\0156\005Tx5zf\006Ӡ\ ! (ʬ:2\022S3PA٨[T\027w&ͧ\023xF\016?ro\001\006;e{\ ! nS78\023B\005oT:_k\020\036ɕ4\015!PUt^ayKu#\ ! \0004\000OD䪂\012\025îT\012\0152~\012Z=/\026\011U=\014t\035 Տj\016>^U\037&\027\ ! /߾vt\0378\0321\002\027\027L^iH-=^aSB;o|}~>b8s\ ! \035\011g[p\027of6\025\036\023g2ǘ?sHS\035&ºoWgoV\037QWU\002BhlBU6\ ! `.\033N\001W\002:iʖ3\032\037\022D_YG\016\014\0305\015\033@4_*ӧ\022\003C\ ! k1wM\037E\0371\016\034Yh;1U)wA\026\013[W1\005F\025꫏l[f2\ ! (Be?ڦ\022Պ\001mH};\034>\013')5G)\007+\025\023\027\030\0063^xU~އ\ ! S&\007bU&C]ߍ\007\020N:(؈D*UȦ2/ Update of /cvsroot/spambayes/spambayes/spambayes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7055/spambayes Modified Files: UserInterface.py Log Message: Put a X-Mailer header on our bug report messages, including the version, so that this is guarenteed to get through, even if the user wipes the info from the text of the message. Index: UserInterface.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/spambayes/UserInterface.py,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** UserInterface.py 22 Feb 2004 02:31:18 -0000 1.45 --- UserInterface.py 22 Feb 2004 02:41:50 -0000 1.46 *************** *** 1126,1129 **** --- 1126,1130 ---- outer['CC'] = from_addr outer['From'] = from_addr + outer['X-Mailer'] = Version.get_version_string(self.app_for_version) outer.preamble = self._wrap(message) # To guarantee the message ends with a newline *************** *** 1134,1139 **** ctype, encoding = mimetypes.guess_type(attach) if ctype is None or encoding is not None: ! # No guess could be made, or the file is encoded (compressed), ! # so use a generic bag-of-bits type. ctype = 'application/octet-stream' maintype, subtype = ctype.split('/', 1) --- 1135,1140 ---- ctype, encoding = mimetypes.guess_type(attach) if ctype is None or encoding is not None: ! # No guess could be made, or the file is encoded ! # (compressed), so use a generic bag-of-bits type. ctype = 'application/octet-stream' maintype, subtype = ctype.split('/', 1) From montanaro at users.sourceforge.net Wed Feb 25 17:19:46 2004 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Wed Feb 25 17:25:38 2004 Subject: [Spambayes-checkins] spambayes/contrib tte.py,1.4,1.5 Message-ID: Update of /cvsroot/spambayes/spambayes/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17329 Modified Files: tte.py Log Message: Add a -c flag. "-c ext" is used to trigger writing of a new pair of ham and spam files (both unix mbox files) which contain just the messages which were trained on at least once during the run. This can be used to cull useless messages from the data sets. Index: tte.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/contrib/tte.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tte.py 13 Feb 2004 19:43:36 -0000 1.4 --- tte.py 25 Feb 2004 22:19:43 -0000 1.5 *************** *** 5,26 **** everything scores properly. ! usage %(prog)s [ -h ] -g file -s file [ -d file | -p file ] [ -m N ] [ -r N ] ! -h - print this documentation and exit. ! -g file - take ham from file ! -s file - take spam from file ! -d file - use a database-based classifier named file ! -p file - use a pickle-based classifier named file ! -m N - train on at most N messages (nham == N/2 and nspam == N/2) ! -r N - run at most N rounds (default %(MAXROUNDS)s), even if not ! all messages score correctly ! See Gary Robinson's blog: http://www.garyrobinson.net/2004/02/spam_filtering_.html --- 5,40 ---- everything scores properly. ! usage %(prog)s [ -h ] -g file -s file [ -d file | -p file ] [ -m N ] [ -r N ] [ -c ext ] ! -h - Print this usage message and exit. ! -g file - Take ham from file. ! -s file - Take spam from file. ! -d file - Use a database-based classifier named file. ! -p file - Use a pickle-based classifier named file. ! -m N - Train on at most N messages (nham == N/2 and nspam == N/2). ! -r N - Run at most N rounds (default %(MAXROUNDS)s), even if not ! 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. ! ! Note that the -c command line argument isn't quite as benign as it might ! first appear. Since the tte protocol trains on the same number of ham and ! spam messages, if you use the output of one run as input into a later run ! you will almost certainly train on fewer messages than before since the two ! files will probably not have the same number of messages. The extra ! messages in the longer file will be ignored in future runs until you add ! more messages to the shorter file. ! ! For more detail on the notion of training to exhaustion see Gary Robinson's blog: http://www.garyrobinson.net/2004/02/spam_filtering_.html *************** *** 48,52 **** print >> sys.stderr, __doc__.strip() % globals() ! def train(store, ham, spam, maxmsgs, maxrounds): smisses = hmisses = round = 0 ham_cutoff = Options.options["Categorization", "ham_cutoff"] --- 62,66 ---- print >> sys.stderr, __doc__.strip() % globals() ! def train(store, ham, spam, maxmsgs, maxrounds, tdict): smisses = hmisses = round = 0 ham_cutoff = Options.options["Categorization", "ham_cutoff"] *************** *** 70,77 **** --- 84,93 ---- if store.spamprob(tokenize(hammsg)) > ham_cutoff: hmisses += 1 + tdict[hammsg["message-id"]] = True store.learn(tokenize(hammsg), False) if store.spamprob(tokenize(spammsg)) < spam_cutoff: smisses += 1 + tdict[spammsg["message-id"]] = True store.learn(tokenize(spammsg), True) *************** *** 85,92 **** (round, nmsgs, hmisses, smisses, seconds) nhamleft = 0 try: while True: ! hambone.next() nhamleft += 1 except StopIteration: --- 101,112 ---- (round, nmsgs, hmisses, smisses, seconds) + # We count all untrained messages so the user knows what was skipped. + # We also tag them for saving so we don't lose messages which might have + # value in a future run nhamleft = 0 try: while True: ! msg = hambone.next() ! tdict[msg["message-id"]] = True nhamleft += 1 except StopIteration: *************** *** 96,100 **** try: while True: ! spamcan.next() nspamleft += 1 except StopIteration: --- 116,121 ---- try: while True: ! msg = spamcan.next() ! tdict[msg["message-id"]] = True nspamleft += 1 except StopIteration: *************** *** 103,115 **** def main(args): try: ! opts, args = getopt.getopt(args, "hg:s:d:p:o:m:r:", ["help", "good=", "spam=", "database=", "pickle=", ! "option=", "max=", "maxrounds="]) except getopt.GetoptError, msg: usage(msg) return 1 ! ham = spam = dbname = usedb = None maxmsgs = 0 maxrounds = MAXROUNDS --- 124,137 ---- def main(args): try: ! opts, args = getopt.getopt(args, "hg:s:d:p:o:m:r:c:", ["help", "good=", "spam=", "database=", "pickle=", ! "option=", "max=", "maxrounds=", ! "cullext="]) except getopt.GetoptError, msg: usage(msg) return 1 ! ham = spam = dbname = usedb = cullext = None maxmsgs = 0 maxrounds = MAXROUNDS *************** *** 122,125 **** --- 144,149 ---- elif opt in ("-s", "--spam"): spam = arg + elif opt in ("-c", "--cullext"): + cullext = arg elif opt in ("-m", "--max"): maxmsgs = int(arg) *************** *** 142,149 **** store = storage.open_storage(dbname, usedb) ! train(store, ham, spam, maxmsgs, maxrounds) store.store() return 0 --- 166,201 ---- store = storage.open_storage(dbname, usedb) ! tdict = {} ! train(store, ham, spam, maxmsgs, maxrounds, tdict) store.store() + if cullext is not None: + print "writing new ham mbox..." + n = m = 0 + newham = file(ham + cullext, "w") + for msg in mboxutils.getmbox(ham): + m += 1 + if msg["message-id"] in tdict: + newham.write(str(msg)) + n += 1 + sys.stdout.write("\r%5d of %5d" % (n, m)) + sys.stdout.flush() + sys.stdout.write("\n") + newham.close() + + print "writing new spam mbox..." + n = m = 0 + newspam = file(spam + cullext, "w") + for msg in mboxutils.getmbox(spam): + m += 1 + if msg["message-id"] in tdict: + newspam.write(str(msg)) + n += 1 + sys.stdout.write("\r%5d of %5d" % (n, m)) + sys.stdout.flush() + sys.stdout.write("\n") + newspam.close() + return 0 From montanaro at users.sourceforge.net Thu Feb 26 10:45:51 2004 From: montanaro at users.sourceforge.net (Skip Montanaro) Date: Thu Feb 26 10:51:51 2004 Subject: [Spambayes-checkins] spambayes/contrib tte.py,1.5,1.6 Message-ID: Update of /cvsroot/spambayes/spambayes/contrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21033 Modified Files: tte.py Log Message: describe -o arg in the usage message Index: tte.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/contrib/tte.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tte.py 25 Feb 2004 22:19:43 -0000 1.5 --- tte.py 26 Feb 2004 15:45:48 -0000 1.6 *************** *** 5,9 **** everything scores properly. ! usage %(prog)s [ -h ] -g file -s file [ -d file | -p file ] [ -m N ] [ -r N ] [ -c ext ] -h - Print this usage message and exit. --- 5,10 ---- everything scores properly. ! usage %(prog)s [ -h ] -g file -s file [ -d file | -p file ] \ ! [ -m N ] [ -r N ] [ -c ext ] [ -o sect:opt:val ] -h - Print this usage message and exit. *************** *** 28,31 **** --- 29,35 ---- input) are retained. + -o sect:opt:val - + Set [sect, opt] in the options database to val. + Note that the -c command line argument isn't quite as benign as it might first appear. Since the tte protocol trains on the same number of ham and From mhammond at users.sourceforge.net Thu Feb 26 21:52:53 2004 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Thu Feb 26 21:58:58 2004 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs dialog_map.py, 1.36, 1.37 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4485/dialogs Modified Files: dialog_map.py Log Message: Remove some debugging print statements. Index: dialog_map.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/dialog_map.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** dialog_map.py 16 Dec 2003 05:06:33 -0000 1.36 --- dialog_map.py 27 Feb 2004 02:52:50 -0000 1.37 *************** *** 177,181 **** def Done(self): - print "TabProcessor Done" if self.currentPageHwnd is not None: if not self.currentPage.SaveAllControls(): --- 177,180 ---- *************** *** 369,373 **** progress.set_stages(stages) - print "About to train with", config.training.spam_folder_ids train.real_trainer(classifier_data, config, mgr.message_store, progress) --- 368,371 ---- From mhammond at users.sourceforge.net Thu Feb 26 21:57:43 2004 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Thu Feb 26 22:03:46 2004 Subject: [Spambayes-checkins] spambayes/Outlook2000 msgstore.py,1.83,1.84 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4654 Modified Files: msgstore.py Log Message: * GetParent() catches MAPI errors and raises a MsgStoreException, fixing a bug reported on the list (the wizard didn't expect COM exceptions) * MAPI docs say best performance is to call .SetColumns() before .Restrict(), and this does make a small difference when scoring/training large folders (unfortunately, a 'setup' win rather than 'per-message') Index: msgstore.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/msgstore.py,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** msgstore.py 30 Dec 2003 16:26:32 -0000 1.83 --- msgstore.py 27 Feb 2004 02:57:40 -0000 1.84 *************** *** 499,508 **** while parent is not None: parts.insert(0, parent.name) ! parent = parent.GetParent() # We now end up with [0] being an empty string??, [1] being the # information store root folder name, etc. Outlook etc all just # use the information store name here. ! if not parts[0]: del parts[0] # Replace the "root" folder name with the information store name # as Outlook, our Folder selector etc do. --- 499,516 ---- while parent is not None: parts.insert(0, parent.name) ! try: ! # Ignore errors fetching parents - the caller just wants the ! # name - it may not be correctly 'fully qualified', but at ! # least we get something. ! parent = parent.GetParent() ! except MsgStoreException: ! break # We now end up with [0] being an empty string??, [1] being the # information store root folder name, etc. Outlook etc all just # use the information store name here. ! if parts and not parts[0]: del parts[0] + # Don't catch exceptions on the item itself - that is fatal, + # and should be caught by the caller. # Replace the "root" folder name with the information store name # as Outlook, our Folder selector etc do. *************** *** 532,549 **** def GetParent(self): ! # return a folder object with the parent, or None ! folder = self.msgstore._OpenEntry(self.id) ! prop_ids = PR_PARENT_ENTRYID, ! hr, data = folder.GetProps(prop_ids,0) ! # Put parent ids together ! parent_eid = data[0][1] ! parent_id = self.id[0], parent_eid ! if hr != 0 or \ ! self.msgstore.session.CompareEntryIDs(parent_eid, self.id[1]): ! # No parent EID, or EID same as ours. ! return None ! parent = self.msgstore._OpenEntry(parent_id) ! # Finally get the display name. ! return self._FolderFromMAPIFolder(parent) def OpenEntry(self, iid = None, flags = None): --- 540,563 ---- def GetParent(self): ! # return a folder object with the parent, or None if there is no ! # parent (ie, a top-level folder). Raises an exception if there is ! # an error fetching the parent (which implies something wrong with the ! # item itself, rather than this being top-level) ! try: ! folder = self.msgstore._OpenEntry(self.id) ! prop_ids = PR_PARENT_ENTRYID, ! hr, data = folder.GetProps(prop_ids,0) ! # Put parent ids together ! parent_eid = data[0][1] ! parent_id = self.id[0], parent_eid ! if hr != 0 or \ ! self.msgstore.session.CompareEntryIDs(parent_eid, self.id[1]): ! # No parent EID, or EID same as ours. ! return None ! parent = self.msgstore._OpenEntry(parent_id) ! # Finally get the item itself ! return self._FolderFromMAPIFolder(parent) ! except pythoncom.com_error, details: ! raise MsgStoreExceptionFromCOMException(details) def OpenEntry(self, iid = None, flags = None): *************** *** 561,564 **** --- 575,579 ---- folder = self.OpenEntry() table = folder.GetContentsTable(0) + table.SetColumns(MAPIMsgStoreMsg.message_init_props, 0) if only_filter_candidates: # Limit ourselves to IPM.* objects - ie, messages. *************** *** 568,572 **** (PR_MESSAGE_CLASS_A, "IPM."))) # with this value table.Restrict(restriction, 0) - table.SetColumns(MAPIMsgStoreMsg.message_init_props, 0) while 1: # Getting 70 at a time was the random number that gave best --- 583,586 ---- From mhammond at users.sourceforge.net Thu Feb 26 21:59:53 2004 From: mhammond at users.sourceforge.net (Mark Hammond) Date: Thu Feb 26 22:05:57 2004 Subject: [Spambayes-checkins] spambayes/Outlook2000/dialogs FolderSelector.py, 1.35, 1.36 Message-ID: Update of /cvsroot/spambayes/spambayes/Outlook2000/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6065/dialogs Modified Files: FolderSelector.py Log Message: Handle the fact that GetParent() may raise an exception, in which case we aren't able to show the item in the tree. Index: FolderSelector.py =================================================================== RCS file: /cvsroot/spambayes/spambayes/Outlook2000/dialogs/FolderSelector.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** FolderSelector.py 30 Dec 2003 16:26:32 -0000 1.35 --- FolderSelector.py 27 Feb 2004 02:59:51 -0000 1.36 *************** *** 379,383 **** folder = None while folder is not None: ! parent = folder.GetParent() if parent is not None and \ not self.InIDs(parent.GetID(), folders_to_expand): --- 379,387 ---- folder = None while folder is not None: ! try: ! parent = folder.GetParent() ! except self.manager.message_store.MsgStoreException, details: ! print "Can't find folder's parent:", details ! parent = None if parent is not None and \ not self.InIDs(parent.GetID(), folders_to_expand):