From marko at von-oppen.com Fri Dec 1 07:27:48 2023 From: marko at von-oppen.com (Marko von Oppen) Date: Fri, 1 Dec 2023 13:27:48 +0100 Subject: [spambayes-dev] Dev environment setup In-Reply-To: References: <63b1f2a8-6f8a-4160-bdfa-b5949a276d2d@gmail.com> Message-ID: Hello John, in the last few days I did some additional work based on the code from here: https://github.com/mpwillson/spambayes3 Here at least the Spambayes core functionality is already running under Python3 (There are other similar repositories available too). It supports also Berkeley DB. From my understanding Berkeley DB is not supported anymore by modern Linux distributions like Debian. So It's not an option for me. The code in the repository seems to support standard Python pickle and ZODB-pickle what is available? at least on modern Linux. From the comments in the code I assume that ZODB is the best option when you do not want to use a real SQL database backend but I have not used Zope/ZODB on Windows for nearly 20 years. So I don't know if ZODB is an option for you. Maybe ZODB is easy available in pip. As I'm planning to use sb_filter.py, I re-activated MySQL as DB in the code there and it is running well against my old Spambayes database. PostgreSQL should work too. Currently I'm working on some modernization of this code, using argparse instead of getopt, logging module instaed of printf(), modern string formatting and so on. Also I'll do some SQL optimizations ("insert ... on duplicate key ...", specify charset on table creation and so on). Too I want to implement a new feature by adding support for "langdetect". As I get emails in different languages with overlapping words and very different Ham/Spam ratios I suppose tagging all words with the email's language could reasonable improve the results. I'll share my changes here https://github.com/mvoppen/spambayes3 soon. BR Marko Am 01.12.2023 um 02:39 schrieb John Cherney: > > I think I?ve gotten most of the code converted to Python 3.12. I?m at > the point now where I have to get the database working. It looks like > bsddb is only supported up to 3.9. Its replacement is berkeleydb from > Oracle, but I?d need to set up an account to download the installer. > I?m assuming berkeleydb is freeware and redistributable, but I?d have > to look into that. Before I go that far, though, is there a different > database (maybe one already built into python, or a python friendly > db) that you would recommend? Ideally, the db would be just a drop-in > replacement for bsddb. > > Thanks, > > jwc > > *From:* John Cherney > *Sent:* Saturday, November 18, 2023 6:07 PM > *To:* Marko von Oppen ; Skip Montanaro > ; mhammond at skippinet.com.au > *Cc:* spambayes-dev at python.org > *Subject:* RE: [spambayes-dev] Dev environment setup > > Thank you, Marko! That did help. I found DebugView at > https://learn.microsoft.com/en-us/sysinternals/downloads/debugview. > When I re-enable the spambayes add-in, I see the errors pop up in the > debugview window. At this point, I haven?t had to install anything > new. I?m playing around with the PATH and PYTHONPATH so the modules > are found, and then adjusting code to python3. Fortunately, the > changes fall within my limited knowledge of python and ability to > google. It isn?t fast progress, but it?s progress. > > For your other question: Spambayes with Python3, there is none that I > could find. I?m hoping it?s just syntax changes that are required to > get this running on a 64-bit MS Office install with Python3. > > Thanks! > > jwc > > *From:* Marko von Oppen > *Sent:* Thursday, November 16, 2023 7:38 PM > *To:* John Cherney ; Skip Montanaro > ; mhammond at skippinet.com.au > *Cc:* spambayes-dev at python.org > *Subject:* Re: [spambayes-dev] Dev environment setup > > Hello jwc, > > some 15 years ago I was a little bit involved in the development of > the Outlook plugin. I do not remember much because I also switched to > Thunderbird in 2007 and have not used Outlook since that nor did I > develop anything for Windows since that except some Python console > scripting. > > I remember one thing, when you write that you see no output. In the > development tools at that time there existed a Windows function > "OutputDebugMsg()" and an application from Microsoft named "Debug > Monitor" catching all debug output. If I remember correctly things > like Python exceptions where redirected to that application if no > other debugger running. > > I do not know if this mechanism still exists in modern Windows but > maybe it could be a hint where to start searching. > > BR > > Marko > > Am 15.11.2023 um 04:48 schrieb John Cherney: > > Thank you for the info and support! > > Do either of you use the Outlook client, and if so, can you > suggest and alternate spam filter? I agree gmail does a great job > keeping out spam. I want to still use the Outlook client for my > Microsoft email accounts. (Although I suppose I could be convinced > to use their web client, but I think its spam filtering is just > like the Outlook client) > > With the help of Google and StackOverflow, I was able to get the > local code running with Python3.12 and get the Add In gets > registered. But it has the same issue as with the original 1.1a6 > install. Outlook complains that there is a runtime error on > loading of the Add In, and the add-in is disabled. Any ideas on > where I could go to see that exception? I was hoping something > would go in the EventViewer, or in a log file somewhere, but I > haven?t found anything yet. > > Thanks, > > jwc > > *From:* Skip Montanaro > > *Sent:* Monday, November 13, 2023 2:57 PM > *To:* mhammond at skippinet.com.au > *Cc:* John Cherney > ; spambayes-dev at python.org > *Subject:* Re: [spambayes-dev] Dev environment setup > > Thanks for responding Mark. As you indicated, SpamBayes has been > on long-term hiatus. The biggest impressive for me are a) Gmail > does a good job, and b) I've so far been unable to convince anyone > with Windows packaging experience to update that side of things. > > That said, porting most of it to Python 3 isn't likely to be all > that difficult. A couple of us have taken partial cracks at it. > > Skip > > On Mon, Nov 13, 2023, 10:13?AM Mark Hammond > wrote: > > I don't think SpamBayes has any current developers and most > work dried up even before Python 3 was ready. Modern Outlook > also hasn't been tested. So I suspect you are probably on your > own here, but those of us left holding the keys would be happy > to arrange any doc etc changes you might make get committed if > possible. > > Cheers, > > Mark > > On 2023-11-12 10:57 p.m., John Cherney wrote: > > Is there a recommended set of versions of tools and > libraries for Spambayes development? (In particular, is > there a recommended setup for python 3.x?) > > I would like to get Spambayes to work on a Windows 10 > 64-bit machine. The current recommendation works on my > machine: Use the 32-bit version of Office 365 Outlook and > install Spambayes into a non-standard directory like > C:/Spambayes. Given that the software works under those > conditions on a 64-bit machine, it makes me think that > there is some interaction (registry key, etc) missing for > Outlook 64-bit to recognize Spambayes. Maybe this is > something as simple as rebuilding the installer on a > 64-bit machine? (Ok, realistically, I?m sure someone has > already tried that.) > > Additionally, is there any way to see the runtime error > being generated? Outlook 64-bit recognizes that Spambayes > is there but generates this message in the Add-ins window: > ?Load Behavior: Not loaded. A runtime error occurred > during the loading of the COM Add-in.? Where can I see > that runtime error? Maybe it?s a problem that?s already > been solved? I remember seeing some DEP related issues > with Outlook and/or the Spambayes plugin. I didn?t have > any luck trying to disable DEP on the machine or disable > it for Outlook (per the FAQ). Any other suggestions? > > Thanks, > > jwc > > _______________________________________________ > > spambayes-dev mailing list > > spambayes-dev at python.org > > https://mail.python.org/mailman/listinfo/spambayes-dev > > _______________________________________________ > spambayes-dev mailing list > spambayes-dev at python.org > https://mail.python.org/mailman/listinfo/spambayes-dev > > _______________________________________________ > > spambayes-dev mailing list > > spambayes-dev at python.org > > https://mail.python.org/mailman/listinfo/spambayes-dev > > > _______________________________________________ > spambayes-dev mailing list > spambayes-dev at python.org > https://mail.python.org/mailman/listinfo/spambayes-dev -- *Marko von Oppen - Technische Software* N?rnberger Str. 43, 01187 Dresden fon +49 (0)351 21118511, fax +49 (0)351 27229679 e-mail marko at von-oppen.com web www.von-oppen.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From tony.meyer at gmail.com Sat Dec 2 03:20:30 2023 From: tony.meyer at gmail.com (Tony Meyer) Date: Sat, 2 Dec 2023 21:20:30 +1300 Subject: [spambayes-dev] Dev environment setup In-Reply-To: References: <63b1f2a8-6f8a-4160-bdfa-b5949a276d2d@gmail.com> Message-ID: Hi, For what it's worth, of the storage backends in the sourceforge version: * pickle: probably still best for the research tools since it's basically just an in-memory dict that is dumped to disk * dbm: this could be bsddb3, but also gdm and others. Out of date. * Postgres: should still be fine - could be worth using if you already have a Postgres server * MySQL: same as Postgres (MariaDB also works with this) * CDB: out of date * ZODB: no idea if this would still work * Zeo: probably doesn't work I believe Skip's copy on Github already drops a bunch of these. If you're not already using MySQL/MariaDB/postgres and aren't doing training, then my guess would be that sqlite3 would likely be the best storage backend to add. It's fast, has stdlib support, does everything needed if you don't need concurrent access or replication, and should be able to mostly use the existing SQLClassifier base class. I could help/write a sqlite3 storage class if anyone needed that. Factoring in the language can definitely help accuracy. I probably can't go into too much detail on this, but I have used SpamBayes with language detection additions in very large scale deployments with good results. Ng? mihi, Tony On Sat, 2 Dec 2023 at 2:04?AM, Marko von Oppen wrote: > Hello John, > > in the last few days I did some additional work based on the code from > here: > > https://github.com/mpwillson/spambayes3 > > Here at least the Spambayes core functionality is already running under > Python3 (There are other similar repositories available too). > > It supports also Berkeley DB. From my understanding Berkeley DB is not > supported anymore by modern Linux distributions like Debian. So It's not an > option for me. > > The code in the repository seems to support standard Python pickle and > ZODB-pickle what is available at least on modern Linux. From the > comments in the code I assume that ZODB is the best option when you do not > want to use a real SQL database backend but I have not used Zope/ZODB on > Windows for nearly 20 years. So I don't know if ZODB is an option for you. > Maybe ZODB is easy available in pip. > > As I'm planning to use sb_filter.py, I re-activated MySQL as DB in the > code there and it is running well against my old Spambayes database. > PostgreSQL should work too. > > Currently I'm working on some modernization of this code, using argparse instead > of getopt, logging module instaed of printf(), modern string formatting > and so on. Also I'll do some SQL optimizations ("insert ... on duplicate > key ...", specify charset on table creation and so on). > > > Too I want to implement a new feature by adding support for "langdetect". > As I get emails in different languages with overlapping words and very > different Ham/Spam ratios I suppose tagging all words with the email's > language could reasonable improve the results. > > I'll share my changes here https://github.com/mvoppen/spambayes3 soon. > > > BR > > Marko > > > > Am 01.12.2023 um 02:39 schrieb John Cherney: > > I think I?ve gotten most of the code converted to Python 3.12. I?m at the > point now where I have to get the database working. It looks like bsddb is > only supported up to 3.9. Its replacement is berkeleydb from Oracle, but > I?d need to set up an account to download the installer. I?m assuming > berkeleydb is freeware and redistributable, but I?d have to look into that. > Before I go that far, though, is there a different database (maybe one > already built into python, or a python friendly db) that you would > recommend? Ideally, the db would be just a drop-in replacement for bsddb. > > > > Thanks, > > jwc > > > > *From:* John Cherney > *Sent:* Saturday, November 18, 2023 6:07 PM > *To:* Marko von Oppen ; Skip > Montanaro ; > mhammond at skippinet.com.au > *Cc:* spambayes-dev at python.org > *Subject:* RE: [spambayes-dev] Dev environment setup > > > > Thank you, Marko! That did help. I found DebugView at > https://learn.microsoft.com/en-us/sysinternals/downloads/debugview. When > I re-enable the spambayes add-in, I see the errors pop up in the debugview > window. At this point, I haven?t had to install anything new. I?m playing > around with the PATH and PYTHONPATH so the modules are found, and then > adjusting code to python3. Fortunately, the changes fall within my limited > knowledge of python and ability to google. It isn?t fast progress, but it?s > progress. > > > > For your other question: Spambayes with Python3, there is none that I > could find. I?m hoping it?s just syntax changes that are required to get > this running on a 64-bit MS Office install with Python3. > > > > Thanks! > > jwc > > > > > > *From:* Marko von Oppen > *Sent:* Thursday, November 16, 2023 7:38 PM > *To:* John Cherney ; Skip Montanaro < > skip.montanaro at gmail.com>; mhammond at skippinet.com.au > *Cc:* spambayes-dev at python.org > *Subject:* Re: [spambayes-dev] Dev environment setup > > > > Hello jwc, > > some 15 years ago I was a little bit involved in the development of the > Outlook plugin. I do not remember much because I also switched to > Thunderbird in 2007 and have not used Outlook since that nor did I develop > anything for Windows since that except some Python console scripting. > > I remember one thing, when you write that you see no output. In the > development tools at that time there existed a Windows function > "OutputDebugMsg()" and an application from Microsoft named "Debug Monitor" > catching all debug output. If I remember correctly things like Python > exceptions where redirected to that application if no other debugger > running. > > I do not know if this mechanism still exists in modern Windows but maybe > it could be a hint where to start searching. > > BR > > Marko > > > > Am 15.11.2023 um 04:48 schrieb John Cherney: > > Thank you for the info and support! > > > > Do either of you use the Outlook client, and if so, can you suggest and > alternate spam filter? I agree gmail does a great job keeping out spam. I > want to still use the Outlook client for my Microsoft email accounts. > (Although I suppose I could be convinced to use their web client, but I > think its spam filtering is just like the Outlook client) > > > > With the help of Google and StackOverflow, I was able to get the local > code running with Python3.12 and get the Add In gets registered. But it has > the same issue as with the original 1.1a6 install. Outlook complains that > there is a runtime error on loading of the Add In, and the add-in is > disabled. Any ideas on where I could go to see that exception? I was hoping > something would go in the EventViewer, or in a log file somewhere, but I > haven?t found anything yet. > > > > Thanks, > > jwc > > > > *From:* Skip Montanaro > > *Sent:* Monday, November 13, 2023 2:57 PM > *To:* mhammond at skippinet.com.au > *Cc:* John Cherney ; > spambayes-dev at python.org > *Subject:* Re: [spambayes-dev] Dev environment setup > > > > Thanks for responding Mark. As you indicated, SpamBayes has been on > long-term hiatus. The biggest impressive for me are a) Gmail does a good > job, and b) I've so far been unable to convince anyone with Windows > packaging experience to update that side of things. > > > > That said, porting most of it to Python 3 isn't likely to be all that > difficult. A couple of us have taken partial cracks at it. > > > > Skip > > > > On Mon, Nov 13, 2023, 10:13?AM Mark Hammond > wrote: > > I don't think SpamBayes has any current developers and most work dried up > even before Python 3 was ready. Modern Outlook also hasn't been tested. So > I suspect you are probably on your own here, but those of us left holding > the keys would be happy to arrange any doc etc changes you might make get > committed if possible. > > Cheers, > > Mark > > On 2023-11-12 10:57 p.m., John Cherney wrote: > > Is there a recommended set of versions of tools and libraries for > Spambayes development? (In particular, is there a recommended setup for > python 3.x?) > > > > I would like to get Spambayes to work on a Windows 10 64-bit machine. The > current recommendation works on my machine: Use the 32-bit version of > Office 365 Outlook and install Spambayes into a non-standard directory like > C:/Spambayes. Given that the software works under those conditions on a > 64-bit machine, it makes me think that there is some interaction (registry > key, etc) missing for Outlook 64-bit to recognize Spambayes. Maybe this is > something as simple as rebuilding the installer on a 64-bit machine? (Ok, > realistically, I?m sure someone has already tried that.) > > > > Additionally, is there any way to see the runtime error being generated? > Outlook 64-bit recognizes that Spambayes is there but generates this > message in the Add-ins window: ?Load Behavior: Not loaded. A runtime error > occurred during the loading of the COM Add-in.? Where can I see that > runtime error? Maybe it?s a problem that?s already been solved? I remember > seeing some DEP related issues with Outlook and/or the Spambayes plugin. I > didn?t have any luck trying to disable DEP on the machine or disable it for > Outlook (per the FAQ). Any other suggestions? > > > > Thanks, > > jwc > > > > > > > > _______________________________________________ > > spambayes-dev mailing list > > spambayes-dev at python.org > > https://mail.python.org/mailman/listinfo/spambayes-dev > > _______________________________________________ > spambayes-dev mailing list > spambayes-dev at python.org > https://mail.python.org/mailman/listinfo/spambayes-dev > > > > _______________________________________________ > > spambayes-dev mailing list > > spambayes-dev at python.org > > https://mail.python.org/mailman/listinfo/spambayes-dev > > > > _______________________________________________ > spambayes-dev mailing listspambayes-dev at python.orghttps://mail.python.org/mailman/listinfo/spambayes-dev > > -- > > *Marko von Oppen - Technische Software* > N?rnberger Str. 43, 01187 Dresden > > fon +49 (0)351 21118511, fax +49 (0)351 27229679 > e-mail marko at von-oppen.com web www.von-oppen.com > _______________________________________________ > spambayes-dev mailing list > spambayes-dev at python.org > https://mail.python.org/mailman/listinfo/spambayes-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwcherney at hotmail.com Sat Dec 9 10:59:06 2023 From: jwcherney at hotmail.com (John Cherney) Date: Sat, 9 Dec 2023 15:59:06 +0000 Subject: [spambayes-dev] Dev environment setup In-Reply-To: References: <63b1f2a8-6f8a-4160-bdfa-b5949a276d2d@gmail.com> Message-ID: Thank you! Great info. I?m looking into these repos. Hopefully, I can help add to them. Thanks, jwc From: spambayes-dev On Behalf Of Marko von Oppen Sent: Friday, December 1, 2023 7:28 AM To: spambayes-dev at python.org Subject: Re: [spambayes-dev] Dev environment setup Hello John, in the last few days I did some additional work based on the code from here: https://github.com/mpwillson/spambayes3 Here at least the Spambayes core functionality is already running under Python3 (There are other similar repositories available too). It supports also Berkeley DB. From my understanding Berkeley DB is not supported anymore by modern Linux distributions like Debian. So It's not an option for me. The code in the repository seems to support standard Python pickle and ZODB-pickle what is available at least on modern Linux. From the comments in the code I assume that ZODB is the best option when you do not want to use a real SQL database backend but I have not used Zope/ZODB on Windows for nearly 20 years. So I don't know if ZODB is an option for you. Maybe ZODB is easy available in pip. As I'm planning to use sb_filter.py, I re-activated MySQL as DB in the code there and it is running well against my old Spambayes database. PostgreSQL should work too. Currently I'm working on some modernization of this code, using argparse instead of getopt, logging module instaed of printf(), modern string formatting and so on. Also I'll do some SQL optimizations ("insert ... on duplicate key ...", specify charset on table creation and so on). Too I want to implement a new feature by adding support for "langdetect". As I get emails in different languages with overlapping words and very different Ham/Spam ratios I suppose tagging all words with the email's language could reasonable improve the results. I'll share my changes here https://github.com/mvoppen/spambayes3 soon. BR Marko Am 01.12.2023 um 02:39 schrieb John Cherney: I think I?ve gotten most of the code converted to Python 3.12. I?m at the point now where I have to get the database working. It looks like bsddb is only supported up to 3.9. Its replacement is berkeleydb from Oracle, but I?d need to set up an account to download the installer. I?m assuming berkeleydb is freeware and redistributable, but I?d have to look into that. Before I go that far, though, is there a different database (maybe one already built into python, or a python friendly db) that you would recommend? Ideally, the db would be just a drop-in replacement for bsddb. Thanks, jwc From: John Cherney Sent: Saturday, November 18, 2023 6:07 PM To: Marko von Oppen ; Skip Montanaro ; mhammond at skippinet.com.au Cc: spambayes-dev at python.org Subject: RE: [spambayes-dev] Dev environment setup Thank you, Marko! That did help. I found DebugView at https://learn.microsoft.com/en-us/sysinternals/downloads/debugview. When I re-enable the spambayes add-in, I see the errors pop up in the debugview window. At this point, I haven?t had to install anything new. I?m playing around with the PATH and PYTHONPATH so the modules are found, and then adjusting code to python3. Fortunately, the changes fall within my limited knowledge of python and ability to google. It isn?t fast progress, but it?s progress. For your other question: Spambayes with Python3, there is none that I could find. I?m hoping it?s just syntax changes that are required to get this running on a 64-bit MS Office install with Python3. Thanks! jwc From: Marko von Oppen > Sent: Thursday, November 16, 2023 7:38 PM To: John Cherney >; Skip Montanaro >; mhammond at skippinet.com.au Cc: spambayes-dev at python.org Subject: Re: [spambayes-dev] Dev environment setup Hello jwc, some 15 years ago I was a little bit involved in the development of the Outlook plugin. I do not remember much because I also switched to Thunderbird in 2007 and have not used Outlook since that nor did I develop anything for Windows since that except some Python console scripting. I remember one thing, when you write that you see no output. In the development tools at that time there existed a Windows function "OutputDebugMsg()" and an application from Microsoft named "Debug Monitor" catching all debug output. If I remember correctly things like Python exceptions where redirected to that application if no other debugger running. I do not know if this mechanism still exists in modern Windows but maybe it could be a hint where to start searching. BR Marko Am 15.11.2023 um 04:48 schrieb John Cherney: Thank you for the info and support! Do either of you use the Outlook client, and if so, can you suggest and alternate spam filter? I agree gmail does a great job keeping out spam. I want to still use the Outlook client for my Microsoft email accounts. (Although I suppose I could be convinced to use their web client, but I think its spam filtering is just like the Outlook client) With the help of Google and StackOverflow, I was able to get the local code running with Python3.12 and get the Add In gets registered. But it has the same issue as with the original 1.1a6 install. Outlook complains that there is a runtime error on loading of the Add In, and the add-in is disabled. Any ideas on where I could go to see that exception? I was hoping something would go in the EventViewer, or in a log file somewhere, but I haven?t found anything yet. Thanks, jwc From: Skip Montanaro Sent: Monday, November 13, 2023 2:57 PM To: mhammond at skippinet.com.au Cc: John Cherney ; spambayes-dev at python.org Subject: Re: [spambayes-dev] Dev environment setup Thanks for responding Mark. As you indicated, SpamBayes has been on long-term hiatus. The biggest impressive for me are a) Gmail does a good job, and b) I've so far been unable to convince anyone with Windows packaging experience to update that side of things. That said, porting most of it to Python 3 isn't likely to be all that difficult. A couple of us have taken partial cracks at it. Skip On Mon, Nov 13, 2023, 10:13?AM Mark Hammond > wrote: I don't think SpamBayes has any current developers and most work dried up even before Python 3 was ready. Modern Outlook also hasn't been tested. So I suspect you are probably on your own here, but those of us left holding the keys would be happy to arrange any doc etc changes you might make get committed if possible. Cheers, Mark On 2023-11-12 10:57 p.m., John Cherney wrote: Is there a recommended set of versions of tools and libraries for Spambayes development? (In particular, is there a recommended setup for python 3.x?) I would like to get Spambayes to work on a Windows 10 64-bit machine. The current recommendation works on my machine: Use the 32-bit version of Office 365 Outlook and install Spambayes into a non-standard directory like C:/Spambayes. Given that the software works under those conditions on a 64-bit machine, it makes me think that there is some interaction (registry key, etc) missing for Outlook 64-bit to recognize Spambayes. Maybe this is something as simple as rebuilding the installer on a 64-bit machine? (Ok, realistically, I?m sure someone has already tried that.) Additionally, is there any way to see the runtime error being generated? Outlook 64-bit recognizes that Spambayes is there but generates this message in the Add-ins window: ?Load Behavior: Not loaded. A runtime error occurred during the loading of the COM Add-in.? Where can I see that runtime error? Maybe it?s a problem that?s already been solved? I remember seeing some DEP related issues with Outlook and/or the Spambayes plugin. I didn?t have any luck trying to disable DEP on the machine or disable it for Outlook (per the FAQ). Any other suggestions? Thanks, jwc _______________________________________________ spambayes-dev mailing list spambayes-dev at python.org https://mail.python.org/mailman/listinfo/spambayes-dev _______________________________________________ spambayes-dev mailing list spambayes-dev at python.org https://mail.python.org/mailman/listinfo/spambayes-dev _______________________________________________ spambayes-dev mailing list spambayes-dev at python.org https://mail.python.org/mailman/listinfo/spambayes-dev _______________________________________________ spambayes-dev mailing list spambayes-dev at python.org https://mail.python.org/mailman/listinfo/spambayes-dev -- Marko von Oppen - Technische Software N?rnberger Str. 43, 01187 Dresden fon +49 (0)351 21118511, fax +49 (0)351 27229679 e-mail marko at von-oppen.com web www.von-oppen.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwcherney at hotmail.com Sat Dec 9 11:04:26 2023 From: jwcherney at hotmail.com (John Cherney) Date: Sat, 9 Dec 2023 16:04:26 +0000 Subject: [spambayes-dev] Dev environment setup In-Reply-To: References: <63b1f2a8-6f8a-4160-bdfa-b5949a276d2d@gmail.com> Message-ID: Thank you, great info. I?ll look into pickle and dbm, just to see if those work and perform well enough. jwc From: spambayes-dev On Behalf Of Tony Meyer Sent: Saturday, December 2, 2023 3:21 AM To: Marko von Oppen Cc: spambayes-dev at python.org Subject: Re: [spambayes-dev] Dev environment setup Hi, For what it's worth, of the storage backends in the sourceforge version: * pickle: probably still best for the research tools since it's basically just an in-memory dict that is dumped to disk * dbm: this could be bsddb3, but also gdm and others. Out of date. * Postgres: should still be fine - could be worth using if you already have a Postgres server * MySQL: same as Postgres (MariaDB also works with this) * CDB: out of date * ZODB: no idea if this would still work * Zeo: probably doesn't work I believe Skip's copy on Github already drops a bunch of these. If you're not already using MySQL/MariaDB/postgres and aren't doing training, then my guess would be that sqlite3 would likely be the best storage backend to add. It's fast, has stdlib support, does everything needed if you don't need concurrent access or replication, and should be able to mostly use the existing SQLClassifier base class. I could help/write a sqlite3 storage class if anyone needed that. Factoring in the language can definitely help accuracy. I probably can't go into too much detail on this, but I have used SpamBayes with language detection additions in very large scale deployments with good results. Ng? mihi, Tony On Sat, 2 Dec 2023 at 2:04?AM, Marko von Oppen > wrote: Hello John, in the last few days I did some additional work based on the code from here: https://github.com/mpwillson/spambayes3 Here at least the Spambayes core functionality is already running under Python3 (There are other similar repositories available too). It supports also Berkeley DB. From my understanding Berkeley DB is not supported anymore by modern Linux distributions like Debian. So It's not an option for me. The code in the repository seems to support standard Python pickle and ZODB-pickle what is available at least on modern Linux. From the comments in the code I assume that ZODB is the best option when you do not want to use a real SQL database backend but I have not used Zope/ZODB on Windows for nearly 20 years. So I don't know if ZODB is an option for you. Maybe ZODB is easy available in pip. As I'm planning to use sb_filter.py, I re-activated MySQL as DB in the code there and it is running well against my old Spambayes database. PostgreSQL should work too. Currently I'm working on some modernization of this code, using argparse instead of getopt, logging module instaed of printf(), modern string formatting and so on. Also I'll do some SQL optimizations ("insert ... on duplicate key ...", specify charset on table creation and so on). Too I want to implement a new feature by adding support for "langdetect". As I get emails in different languages with overlapping words and very different Ham/Spam ratios I suppose tagging all words with the email's language could reasonable improve the results. I'll share my changes here https://github.com/mvoppen/spambayes3 soon. BR Marko Am 01.12.2023 um 02:39 schrieb John Cherney: I think I?ve gotten most of the code converted to Python 3.12. I?m at the point now where I have to get the database working. It looks like bsddb is only supported up to 3.9. Its replacement is berkeleydb from Oracle, but I?d need to set up an account to download the installer. I?m assuming berkeleydb is freeware and redistributable, but I?d have to look into that. Before I go that far, though, is there a different database (maybe one already built into python, or a python friendly db) that you would recommend? Ideally, the db would be just a drop-in replacement for bsddb. Thanks, jwc From: John Cherney Sent: Saturday, November 18, 2023 6:07 PM To: Marko von Oppen ; Skip Montanaro ; mhammond at skippinet.com.au Cc: spambayes-dev at python.org Subject: RE: [spambayes-dev] Dev environment setup Thank you, Marko! That did help. I found DebugView at https://learn.microsoft.com/en-us/sysinternals/downloads/debugview. When I re-enable the spambayes add-in, I see the errors pop up in the debugview window. At this point, I haven?t had to install anything new. I?m playing around with the PATH and PYTHONPATH so the modules are found, and then adjusting code to python3. Fortunately, the changes fall within my limited knowledge of python and ability to google. It isn?t fast progress, but it?s progress. For your other question: Spambayes with Python3, there is none that I could find. I?m hoping it?s just syntax changes that are required to get this running on a 64-bit MS Office install with Python3. Thanks! jwc From: Marko von Oppen > Sent: Thursday, November 16, 2023 7:38 PM To: John Cherney >; Skip Montanaro >; mhammond at skippinet.com.au Cc: spambayes-dev at python.org Subject: Re: [spambayes-dev] Dev environment setup Hello jwc, some 15 years ago I was a little bit involved in the development of the Outlook plugin. I do not remember much because I also switched to Thunderbird in 2007 and have not used Outlook since that nor did I develop anything for Windows since that except some Python console scripting. I remember one thing, when you write that you see no output. In the development tools at that time there existed a Windows function "OutputDebugMsg()" and an application from Microsoft named "Debug Monitor" catching all debug output. If I remember correctly things like Python exceptions where redirected to that application if no other debugger running. I do not know if this mechanism still exists in modern Windows but maybe it could be a hint where to start searching. BR Marko Am 15.11.2023 um 04:48 schrieb John Cherney: Thank you for the info and support! Do either of you use the Outlook client, and if so, can you suggest and alternate spam filter? I agree gmail does a great job keeping out spam. I want to still use the Outlook client for my Microsoft email accounts. (Although I suppose I could be convinced to use their web client, but I think its spam filtering is just like the Outlook client) With the help of Google and StackOverflow, I was able to get the local code running with Python3.12 and get the Add In gets registered. But it has the same issue as with the original 1.1a6 install. Outlook complains that there is a runtime error on loading of the Add In, and the add-in is disabled. Any ideas on where I could go to see that exception? I was hoping something would go in the EventViewer, or in a log file somewhere, but I haven?t found anything yet. Thanks, jwc From: Skip Montanaro Sent: Monday, November 13, 2023 2:57 PM To: mhammond at skippinet.com.au Cc: John Cherney ; spambayes-dev at python.org Subject: Re: [spambayes-dev] Dev environment setup Thanks for responding Mark. As you indicated, SpamBayes has been on long-term hiatus. The biggest impressive for me are a) Gmail does a good job, and b) I've so far been unable to convince anyone with Windows packaging experience to update that side of things. That said, porting most of it to Python 3 isn't likely to be all that difficult. A couple of us have taken partial cracks at it. Skip On Mon, Nov 13, 2023, 10:13?AM Mark Hammond > wrote: I don't think SpamBayes has any current developers and most work dried up even before Python 3 was ready. Modern Outlook also hasn't been tested. So I suspect you are probably on your own here, but those of us left holding the keys would be happy to arrange any doc etc changes you might make get committed if possible. Cheers, Mark On 2023-11-12 10:57 p.m., John Cherney wrote: Is there a recommended set of versions of tools and libraries for Spambayes development? (In particular, is there a recommended setup for python 3.x?) I would like to get Spambayes to work on a Windows 10 64-bit machine. The current recommendation works on my machine: Use the 32-bit version of Office 365 Outlook and install Spambayes into a non-standard directory like C:/Spambayes. Given that the software works under those conditions on a 64-bit machine, it makes me think that there is some interaction (registry key, etc) missing for Outlook 64-bit to recognize Spambayes. Maybe this is something as simple as rebuilding the installer on a 64-bit machine? (Ok, realistically, I?m sure someone has already tried that.) Additionally, is there any way to see the runtime error being generated? Outlook 64-bit recognizes that Spambayes is there but generates this message in the Add-ins window: ?Load Behavior: Not loaded. A runtime error occurred during the loading of the COM Add-in.? Where can I see that runtime error? Maybe it?s a problem that?s already been solved? I remember seeing some DEP related issues with Outlook and/or the Spambayes plugin. I didn?t have any luck trying to disable DEP on the machine or disable it for Outlook (per the FAQ). Any other suggestions? Thanks, jwc _______________________________________________ spambayes-dev mailing list spambayes-dev at python.org https://mail.python.org/mailman/listinfo/spambayes-dev _______________________________________________ spambayes-dev mailing list spambayes-dev at python.org https://mail.python.org/mailman/listinfo/spambayes-dev _______________________________________________ spambayes-dev mailing list spambayes-dev at python.org https://mail.python.org/mailman/listinfo/spambayes-dev _______________________________________________ spambayes-dev mailing list spambayes-dev at python.org https://mail.python.org/mailman/listinfo/spambayes-dev -- Marko von Oppen - Technische Software N?rnberger Str. 43, 01187 Dresden fon +49 (0)351 21118511, fax +49 (0)351 27229679 e-mail marko at von-oppen.com web www.von-oppen.com _______________________________________________ spambayes-dev mailing list spambayes-dev at python.org https://mail.python.org/mailman/listinfo/spambayes-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwcherney at hotmail.com Wed Dec 13 23:37:13 2023 From: jwcherney at hotmail.com (John Cherney) Date: Thu, 14 Dec 2023 04:37:13 +0000 Subject: [spambayes-dev] Any thoughts on this exception? Message-ID: I've made some progress. I've cloned smontanaro's spambayes repo and used that as a starting point. I think I've gotten most, of the 2.x to 3.x conversions. I have the Add-in registered. I have the Add-ins menu showing up. But (and there has to be a 'but') I can't seem to get the win32com mapi to read anything meaningful. I haven't seen anything helpful in my Google searches. I'm throwing this out there hoping that someone has seen something like this and can get me unstuck. Loaded bayes database from 'C:\\default_bayes_database.fs' Loaded message database from 'C:\\default_message_database.fs' Bayes database initialized with 0 spam and 0 good messages SpamBayes Outlook Addin Version 2.0a1 (Aug 25, 2022) from source on Windows 10.0.19045 () using Python 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)] Log created Wed Dec 13 22:53:24 2023 *** SpamBayes is NOT enabled, so will not filter incoming mail. *** Creating new SpamBayes toolbar to host our buttons Error finding the MAPI folders for a folder switch event ERROR: '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.' Traceback (most recent call last): File "C:\\spambayes\Outlook2000\msgstore.py", line 347, in GetFolder folder = self._OpenEntry(folder_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\\spambayes\Outlook2000\msgstore.py", line 274, in _OpenEntry store = self._GetMessageStore(store_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\\spambayes\Outlook2000\msgstore.py", line 247, in _GetMessageStore store = self.session.OpenMsgStore( ^^^^^^^^^^^^^^^^^^^^^^^^^^ pywintypes.com_error: (-2147221241, 'OLE error 0x80040107', None, None) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\\spambayes\Outlook2000\addin.py", line 1178, in OnFolderSwitch mapi_folder = self.manager.message_store.GetFolder(outlook_folder) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\\spambayes\Outlook2000\msgstore.py", line 355, in GetFolder raise MsgStoreExceptionFromCOMException(details) msgstore.MsgStoreException: MsgStoreException: Exception 0x-7ffbfef9 (MAPI_E_INVALID_ENTRYID): OLE error 0x80040107 ERROR: '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.' One thing I'm suspicious of (and I hope I'm wrong) is if the problem is the win32 related modules. I'm doing this on a 64bit machine, trying to get this to work with the 64bit install of Outlook (Office 365). Could that be my problem? Should I be looking for win64 related modules? (Do any exist? I didn't see any on pypi.org? Or is that also a wrong direction?) At this point, I don't know enough about COM or 32bit vs 64bit to know what to try next. Thanks in advance, jwc -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhammond at skippinet.com.au Thu Dec 14 11:29:29 2023 From: mhammond at skippinet.com.au (Mark Hammond) Date: Thu, 14 Dec 2023 11:29:29 -0500 Subject: [spambayes-dev] Any thoughts on this exception? In-Reply-To: References: Message-ID: <53a4953b-edec-461a-ae63-f4b50fe83034@skippinet.com.au> That exception looks more like we can't access the message store rather than a 64/32 bit mismatch. It may be that you need to enable MAPI access or something similar but I'm afraid I've never used newer versions of office. Googling for MAPI_E_INVALID_ENTRYID with Office 365 is probably the best path forward. Cheers, Mark On 2023-12-13 11:37 p.m., John Cherney wrote: > > I?ve made some progress. I?ve cloned smontanaro?s spambayes repo and > used that as a starting point. I think I?ve gotten most, of the 2.x to > 3.x conversions. I have the Add-in registered. I have the Add-ins menu > showing up. But (and there has to be a ?but?) I can?t seem to get the > win32com mapi to read anything meaningful. I haven?t seen anything > helpful in my Google searches. I?m throwing this out there hoping that > someone has seen something like this and can get me unstuck. > > Loaded bayes database from 'C:\\default_bayes_database.fs' > > Loaded message database from 'C:\\default_message_database.fs' > > Bayes database initialized with 0 spam and 0 good messages > > SpamBayes Outlook Addin Version 2.0a1 (Aug 25, 2022) from source > > on Windows 10.0.19045 () > > using Python 3.12.0 (tags/v3.12.0:0fb18b0, Oct? 2 2023, 13:03:39) [MSC > v.1935 64 bit (AMD64)] > > Log created Wed Dec 13 22:53:24 2023 > > *** SpamBayes is NOT enabled, so will not filter incoming mail. *** > > Creating new SpamBayes toolbar to host our buttons > > Error finding the MAPI folders for a folder switch event > > ERROR: '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.' > > Traceback (most recent call last): > > File "C:\\spambayes\Outlook2000\msgstore.py", line 347, in > GetFolder > > folder = self._OpenEntry(folder_id) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "C:\\spambayes\Outlook2000\msgstore.py", line 274, in > _OpenEntry > > store = self._GetMessageStore(store_id) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "C:\\spambayes\Outlook2000\msgstore.py", line 247, in > _GetMessageStore > > store = self.session.OpenMsgStore( > > ^^^^^^^^^^^^^^^^^^^^^^^^^^ > > pywintypes.com_error: (-2147221241, 'OLE error 0x80040107', None, None) > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > > File "C:\\spambayes\Outlook2000\addin.py", line 1178, in > OnFolderSwitch > > mapi_folder = self.manager.message_store.GetFolder(outlook_folder) > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "C:\\spambayes\Outlook2000\msgstore.py", line 355, in > GetFolder > > raise MsgStoreExceptionFromCOMException(details) > > msgstore.MsgStoreException: MsgStoreException: Exception 0x-7ffbfef9 > (MAPI_E_INVALID_ENTRYID): OLE error 0x80040107 > > ERROR: '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.' > > One thing I?m suspicious of (and I hope I?m wrong) is if the problem > is the win32 related modules. I?m doing this on a 64bit machine, > trying to get this to work with the 64bit install of Outlook (Office > 365). Could that be my problem? Should I be looking for win64 related > modules? (Do any exist? I didn?t see any on pypi.org? Or is that also > a wrong direction?) At this point, I don?t know enough about COM or > 32bit vs 64bit to know what to try next. > > Thanks in advance, > > jwc > > > _______________________________________________ > spambayes-dev mailing list > spambayes-dev at python.org > https://mail.python.org/mailman/listinfo/spambayes-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwcherney at hotmail.com Fri Dec 29 22:11:14 2023 From: jwcherney at hotmail.com (John Cherney) Date: Sat, 30 Dec 2023 03:11:14 +0000 Subject: [spambayes-dev] Any thoughts on this exception? In-Reply-To: <53a4953b-edec-461a-ae63-f4b50fe83034@skippinet.com.au> References: <53a4953b-edec-461a-ae63-f4b50fe83034@skippinet.com.au> Message-ID: Ok. I'll take that as good news. I have been able to reproduce this exception through the IDE debugger by just running msgstore.py by itself. It appears that the call to MAPIMsgStore constructor (in function test) is returning successfully, and it looks like valid data. The exception happens on the next line, in the store.GetFolderGenerator function. I can't seem to generate a valid folder (store_id and entry_id tuple). The store_id and entry_id are strings. Are they supposed to be encoded as something else in Python3 in order to work with pywin32 and mapi? Byte strings don't seem to work. The call originally had mapi.BinFromHex in NormalizeId, but that doesn't seem to work with Python strings, or byte strings. Because NormalizeId isn't generating something useful, the call to _OpenEntry a few lines later, which calls _GetMessageStore, which calls session.OpenMsgStore, fails. I'm not familiar enough with this Outlook Add Ins or the pywin32 library to guess a next step. Could this be a permissions issue? I'd like to think not, since the 32 bit version of Outlook works with Spambayes, and, with the 64 bit version of Outlook, the MAPILogonEx call seems to work. jwc From: Mark Hammond Sent: Thursday, December 14, 2023 11:29 AM To: John Cherney ; spambayes-dev at python.org Subject: Re: [spambayes-dev] Any thoughts on this exception? That exception looks more like we can't access the message store rather than a 64/32 bit mismatch. It may be that you need to enable MAPI access or something similar but I'm afraid I've never used newer versions of office. Googling for MAPI_E_INVALID_ENTRYID with Office 365 is probably the best path forward. Cheers, Mark On 2023-12-13 11:37 p.m., John Cherney wrote: I've made some progress. I've cloned smontanaro's spambayes repo and used that as a starting point. I think I've gotten most, of the 2.x to 3.x conversions. I have the Add-in registered. I have the Add-ins menu showing up. But (and there has to be a 'but') I can't seem to get the win32com mapi to read anything meaningful. I haven't seen anything helpful in my Google searches. I'm throwing this out there hoping that someone has seen something like this and can get me unstuck. Loaded bayes database from 'C:\\default_bayes_database.fs' Loaded message database from 'C:\\default_message_database.fs' Bayes database initialized with 0 spam and 0 good messages SpamBayes Outlook Addin Version 2.0a1 (Aug 25, 2022) from source on Windows 10.0.19045 () using Python 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)] Log created Wed Dec 13 22:53:24 2023 *** SpamBayes is NOT enabled, so will not filter incoming mail. *** Creating new SpamBayes toolbar to host our buttons Error finding the MAPI folders for a folder switch event ERROR: '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.' Traceback (most recent call last): File "C:\\spambayes\Outlook2000\msgstore.py", line 347, in GetFolder folder = self._OpenEntry(folder_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\\spambayes\Outlook2000\msgstore.py", line 274, in _OpenEntry store = self._GetMessageStore(store_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\\spambayes\Outlook2000\msgstore.py", line 247, in _GetMessageStore store = self.session.OpenMsgStore( ^^^^^^^^^^^^^^^^^^^^^^^^^^ pywintypes.com_error: (-2147221241, 'OLE error 0x80040107', None, None) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\\spambayes\Outlook2000\addin.py", line 1178, in OnFolderSwitch mapi_folder = self.manager.message_store.GetFolder(outlook_folder) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\\spambayes\Outlook2000\msgstore.py", line 355, in GetFolder raise MsgStoreExceptionFromCOMException(details) msgstore.MsgStoreException: MsgStoreException: Exception 0x-7ffbfef9 (MAPI_E_INVALID_ENTRYID): OLE error 0x80040107 ERROR: '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.' One thing I'm suspicious of (and I hope I'm wrong) is if the problem is the win32 related modules. I'm doing this on a 64bit machine, trying to get this to work with the 64bit install of Outlook (Office 365). Could that be my problem? Should I be looking for win64 related modules? (Do any exist? I didn't see any on pypi.org? Or is that also a wrong direction?) At this point, I don't know enough about COM or 32bit vs 64bit to know what to try next. Thanks in advance, jwc _______________________________________________ spambayes-dev mailing list spambayes-dev at python.org https://mail.python.org/mailman/listinfo/spambayes-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: