1

Topic: SpamAssassin bayes in SQL

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.2
- Deployed with iRedMail Easy or the downloadable installer? Downloadable
- Linux/BSD distribution name and version: 18.04.2 Ubuntu
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Web server (Apache or Nginx): NGINX
- Manage mail accounts with iRedAdmin-Pro? Not at the moment
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello,
I have an older server and I'm looking to migrate to a new machine with the latest version of iRedMail.
I've installed the latest build to test with, I understand in Roundcube 1.4 the MarkAsJunk2 plugin is now a included built-in plugin.  When looking at the documentation https://docs.iredmail.org/store.spamass … n.sql.html I feel like it is very outdated. Is the documentation there still accurate? or should I do something else? Due to the levels of Spam my users get, I definitely need them to have the ability to mark things as junk to help S.A. learn

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: SpamAssassin bayes in SQL

Well I decided to give it a go on the test machine while waiting, using the documentation, I downloaded the bayes_mysql.sql file for SpamAssassin verion 3.4.2 as that is what came with iRedMail 1.2 and MariaDB was the only SQL option. I got as far as creating the sa_bayes database, but when I used   SOURCE /root/bayes_mysql.sql;   command it returned with:

Query OK, 0 rows affected (0.43 sec)

Query OK, 0 rows affected (0.42 sec)

Query OK, 1 row affected (0.09 sec)

ERROR 1071 (42000) at line 16 in file: '/root/bayes_mysql.sql': Specified key was too long; max key length is 767 bytes
Query OK, 0 rows affected (0.41 sec)

ERROR 1071 (42000) at line 33 in file: '/root/bayes_mysql.sql': Specified key was too long; max key length is 767 bytes


Any thoughts or advice?

3

Re: SpamAssassin bayes in SQL

Luke6283 wrote:

ERROR 1071 (42000) at line 16 in file: '/root/bayes_mysql.sql': Specified key was too long; max key length is 767 bytes

Try to decrease the index key length.

4

Re: SpamAssassin bayes in SQL

ZhangHuangbin wrote:
Luke6283 wrote:

ERROR 1071 (42000) at line 16 in file: '/root/bayes_mysql.sql': Specified key was too long; max key length is 767 bytes

Try to decrease the index key length.

I tried googling what that means, I still don't understand. Where do I set the SQL index key? Is this just a fancy word for my SQL password?

5

Re: SpamAssassin bayes in SQL

For example:

CREATE TABLE IF NOT EXISTS bayes_seen (
  id int(11) NOT NULL default '0',
  msgid varchar(200) binary NOT NULL default '',
  flag char(1) NOT NULL default '',
  PRIMARY KEY  (id,msgid)
) ENGINE=InnoDB;

Check the 3rd line in above SQL command: `varchar(200)`, the "200" means key length. You need to shorten it. for example, 150.