Skip to content

Simplest possible spam matching fails #92

@nresare

Description

@nresare

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

  1. clone the OrangeAssassin repo
  2. Follow the instructions to be able to run the unit tests (setting up virtualenv, installing deps)
  3. download and install latest spamassassin in a separate prefix
  4. run sa-update to get latest config
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions