Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-43418

spamassassin cannot store bayes tokens in mariadb/mysql database

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Undefined Undefined
    • rhel-9.5
    • rhel-9.4
    • spamassassin
    • None
    • rhel-sst-cs-stacks
    • ssg_core_services
    • 26
    • 2
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • All
    • None

      What were you trying to do that didn't work?

      Using a mariadb database as bayes database with the bayes_store_module Mail::SpamAssassin::BayesStore::MySQL.

      Please provide the package NVR for which bug is seen:

      spamassassin-3.4.6-5.el9.x86_64

      How reproducible:

      Setup spamassassin to use a mariadb database for bayes and import or learn any tokens  with -D debug output enabled.

      There is an error whenever it tries to add a new token:

      dbg: bayes: _put_token: SQL error: Data too long for column 'token' at row 1

      The table bayes_token in the database remains empty.
       

      Steps to reproduce

      1. Install spamassassin and a mariadb database.
      2. Create the database and tables for storage using https://github.com/apache/spamassassin/blob/trunk/sql/bayes_mysql.sql
      3. Configure the database connection in local.cf, e.g.:
        bayes_store_module      Mail::SpamAssassin::BayesStore::MySQL
        bayes_sql_dsn           DBI:MariaDB:database=spamassassin;host=mdb.example.com
        bayes_sql_username      spamassassin
        bayes_sql_password      password
        bayes_sql_override_username     amavis
      1. Import some tokens with sa-learn or learn from spamassassin cli using the -D option to see debug output. You see the error and the table bayes_token remains empty.

      Expected results

      Tokens being added into the bayes_token table.

      Actual results

      No tokens added.

      Notes

      See also thread https://lists.apache.org/thread/396rsbzngm3ydc1ol5xw4mg99d5h1q64

      This has been fixed in spamassassin 4.0. See also my reply in the thread from 19 June 2024 08:41:57 CEST for a possible mitigation by using the 4.0.1 MySQL.pm file.

              rhn-support-mosvald Martin Osvald
              vogt@dkrz.de Gerald Vogt (Inactive)
              Martin Osvald Martin Osvald
              Frantisek Hrdina Frantisek Hrdina
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: