-
Notifications
You must be signed in to change notification settings - Fork 21
Description
With the travis tests finally being green, I'm moving towards actually running OrangeAssassin on my incoming email. However, there was some obstacles in the way related to the bayes plugin, as details below.
Version information
Latest master 6740c10
Steps to replicate
- clone the OrangeAssassin repo
- Follow the instructions to be able to run the unit tests (setting up virtualenv, installing deps)
- download and install latest spamassassin in a separate prefix
- run sa-update to get latest config
- Attempt to run
PYTHONPATH=. ./scripts/match.py -D -t --configpath ~/slask/sa/var/spamassassin/3.004001/updates_spamassassin_org --sitepath ~/slask/sa/etc/mail/spamassassin ~/slask/Mail-SpamAssassin-3.4.1/sample-spam.txt(assuming the spamassassin prefix is~/slask/sa
Actual result
sqlalchemy.exc.UnboundExecutionError: Could not locate a bind configured on SQL expression or this Session
Expected result
A spam report fo the input sample would be printed to stdout.
Other notes
The reason for this error is that the bayes plugin expects to be able to contact a database. Adding for example bayes_sql_dsn sqlite:////Users/noa/.spamassassin/bayes.db to ~/.spamassassin/user_prefs fixes that problem.
Then, there is the problem of the plugin not handling an empty or nonexistent database (fixed by my PR #91)
When that is fixed, there are two logic errors in the way the bayes plugin communicates with the database, also fixed in the above mentioned PR.