meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:spamassassin [2024/08/07 09:05] niziaklinux:spamassassin [2024/08/11 19:41] (current) niziak
Line 11: Line 11:
 spamassassin -D --lint 2>&1 | grep -i failed spamassassin -D --lint 2>&1 | grep -i failed
 </code> </code>
-Aug  7 08:48:15.771 [2880895] dbg: diag: [...] optional module not installed: MaxMind::DB::Reader ('require' failed) 
-Aug  7 08:48:15.771 [2880895] dbg: diag: [...] optional module not installed: MaxMind::DB::Reader::XS ('require' failed) 
-Aug  7 08:48:15.771 [2880895] dbg: diag: [...] optional module not installed: IP::Country::DB_File ('require' failed) 
-Aug  7 08:48:15.771 [2880895] dbg: diag: [...] optional module not installed: IP::Country::Fast ('require' failed) 
  
 <code bash> <code bash>
Line 29: Line 25:
 sudo cpan install IP::Country::DB_File Digest::SHA1 IP::Country::Fast sudo cpan install IP::Country::DB_File Digest::SHA1 IP::Country::Fast
 </code> </code>
 +
 +===== register at DNSWL =====
 +
 +Register legitimate SMTP server at: [[https://www.dnswl.org/selfservice/|dnswl.org Self Service]]
 +
  
 ====== Issues ====== ====== Issues ======
Line 60: Line 61:
 </file> </file>
  
 +====== bayes: tok_get_all: SQL error: Illegal mix of collations for operation ' IN ' ======
  
 +<code bash>
 +spamassassin -D --lint 2>&1 | grep bayes
 +</code>
 +
 +<code>
 +Aug 11 18:10:51.719 [37716] dbg: bayes: tok_get_all: SQL error: Illegal mix of collations for operation 'in'
 +Aug 11 18:10:51.719 [37716] dbg: bayes: cannot use bayes on this message; none of the tokens were found in the database
 +Aug 11 18:10:51.719 [37716] dbg: bayes: not scoring message, returning undef
 +</code>
 +
 +It was running on very old system, upgraded multiple times. Nowadays other encodings are added to MySQL database.
 +
 +<code sql>
 +ALTER DATABASE sa CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
 +</code>
 +Not possible to convert bayes databases to new charset:
 +<code sql>
 +ALTER TABLE awl CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
 +</code>
 +
 +Recreate tables with new character set (prebiously set for ''sa'' database):
 +  * backup bayes ''sa-learn --backup >backup.txt''
 +  * drop 5 ''bayes_'' tables: ''DROP TABLE `bayes_expire`, `bayes_global_vars`, `bayes_seen`, `bayes_token`, `bayes_vars`;''
 +  * create it again from scheme: ''/usr/share/doc/spamassassin/sql/bayes_mysql.sql''
 +  * ''sa-learn --restore backup.txt''
 +
 +Another problem:
 +  * [[https://lists.apache.org/thread/396rsbzngm3ydc1ol5xw4mg99d5h1q64|BayesStore MariaDB on EL9]]
 +  * [[https://issues.redhat.com/browse/RHEL-43418]]
 +  * [[https://serverfault.com/questions/1029024/can-i-usefully-convert-spamassassin-bayes-tokens-from-utf8-char5-to-binary5]]
 +
 +For me it was faster to train bayes again:
 +<code bash>
 +sa-learn --ham --progress ./hamdir
 +sa-learn --spam --progress ./spamdir
 +</code>