Hello, Bayes is returning undef for all mails passing through our server. Spamassassin 3.2.0, amavisd-new 2.5.0, perl 5.8.8, mysql 5.0.42 and bayes is on InnoDB.
sunny ~ # grep -i bayes /etc/mail/spamassassin/*.cf|grep -v secrets.cf /etc/mail/spamassassin/local.cf:# Use Bayesian classifier (default: 1) /etc/mail/spamassassin/local.cf:# use_bayes 1 /etc/mail/spamassassin/local.cf:# Bayesian classifier auto-learning (default: 1) /etc/mail/spamassassin/local.cf:bayes_auto_learn 0 /etc/mail/spamassassin/local.cf:bayes_auto_expire 0 /etc/mail/spamassassin/local.cf:# Set headers which may provide inappropriate cues to the Bayesian /etc/mail/spamassassin/local.cf:bayes_ignore_header X-Bogosity /etc/mail/spamassassin/local.cf:bayes_ignore_header X-Spam-Flag /etc/mail/spamassassin/local.cf:bayes_ignore_header X-Spam-Status Some messages not getting scored by bayes is understandable but bayes is not scoring for any email. Database corruption? How likely is that? Any suggestions, pointers, RTFMs highly appreciated. su amavis -c 'DBI_TRACE=2 /usr/bin/spamassassin -D bayes < /var/amavis/test' > 2.log 2>&1 gives (with lots of deletions to keep the mail to a reasonable length. Also edited mysql username and password): DBI 1.55-nothread default trace level set to 0x0/2 (pid 5205) at DBI.pm line 271 via SQL.pm line 44 [5205] dbg: bayes: using username: amavis -> DBI->connect(DBI:mysql:spamassassin:localhost, dbuser, ****, HASH(0x177a470)) -> DBI->install_driver(mysql) for linux perl=5.008008 pid=5205 ruid=102 euid=102 install_driver: DBD::mysql version 3.0008 loaded from /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux/DBD/mysql.pm <- install_driver= DBI::dr=HASH(0x28b66a0) !! warn: 0 CLEARED by call to connect method [...] [5205] dbg: bayes: database connection established [...] [5205] dbg: bayes: found bayes db version 3 [...] [5205] dbg: bayes: Using userid: 3 [...] [5205] dbg: bayes: corpus size: nspam = 1668, nham = 1649 [5205] dbg: bayes: header tokens for *p = "U*xxxx D*mail.caf.com.tr D*caf.com.tr D*com.tr D*tr" [5205] dbg: bayes: header tokens for *F = "U*xxxx D*mail.caf.com.tr D*caf.com.tr D*com.tr D*tr" [5205] dbg: bayes: header tokens for To = "U*eray.aslan D*caf.com.tr D*com.tr D*tr" [5205] dbg: bayes: header tokens for MIME-Version = " " [5205] dbg: bayes: header tokens for *c = " multipart/mixed; ----=_ NHxtPHrt _ HHH _ HHHH _ HHHHHHHH . HHHHHHHH" [5205] dbg: bayes: header tokens for *x = " Microsoft Office Outlook, Build 11.0.6353" [5205] dbg: bayes: header tokens for X-MimeOLE = " Produced By Microsoft MimeOLE V6.00.2900.2180" [5205] dbg: bayes: header tokens for *m = " 20050925191650 D930E6923 mail caf com tr " [5205] dbg: bayes: header tokens for X-Relay-Countries = " TR" [5205] dbg: bayes: header tokens for X-Spam-Relays-External = " [ ip=195.174.218.167 rdns= helo=KAHVE by=mail.caf.com.tr ident= envfrom= intl=0 id=D930E6923 auth= msa=0 ]" [5205] dbg: bayes: header tokens for X-Spam-Relays-Internal = " [ ip=127.0.0.1 rdns=mail.caf.com.tr helo=localhost by=mail.caf.com.tr ident= envfrom= intl=1 id=49C481B07F auth= msa=0 ] [ ip=127.0.0.1 rdns= helo=mail.caf.com.tr by=localhost ident= envfrom= intl=1 id=12605-08 auth= msa=0 ]" [5205] dbg: bayes: header tokens for *RT = " [ ip=127.0.0.1 rdns=mail.caf.com.tr helo=localhost by=mail.caf.com.tr ident= envfrom= intl=1 id=49C481B07F auth= msa=0 ] [ ip=127.0.0.1 rdns= helo=mail.caf.com.tr by=localhost ident= envfrom= intl=1 id=12605-08 auth= msa=0 ]" [5205] dbg: bayes: header tokens for *RU = " [ ip=195.174.218.167 rdns= helo=KAHVE by=mail.caf.com.tr ident= envfrom= intl=0 id=D930E6923 auth= msa=0 ]" [5205] dbg: bayes: header tokens for *r = " KAHVE (unknown [195.174.218 ip*195.174.218.167 ]) (using TLSv1 cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mail.caf.com.tr (Postfix) <[EMAIL PROTECTED]>; " [5205] dbg: bayes: header tokens for *r = " KAHVE (unknown [195.174.218 ip*195.174.218.167 ]) (using TLSv1 cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by mail.caf.com.tr (Postfix) <[EMAIL PROTECTED]>; mail.caf.com.tr ([127.0.0 ip*127.0.0.1 ]) by localhost (mail.caf.com.tr [127.0.0 ip*127.0.0.1 ]) (amavisd-new, port 10024) id 12605-08; " [5205] dbg: bayes: tok_get_all: token count: 145 -> prepare for DBD::mysql::db (DBI::db=HASH(0x28d1fe0)~0x28d1ed0 'SELECT RPAD(token, 5, ' '), spam_count, ham_count, atime FROM bayes_token WHERE id = ? AND token IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)') dbd_st_prepare calling count_params (counting params emulation) <- prepare= DBI::st=HASH(0x28e2cd0) at SQL.pm line 892 -> execute for DBD::mysql::st (DBI::st=HASH(0x28e2cd0)~0x2a4fc40 '3' '�.j�f' '.GW.�' 'QJ+�1' '���|.' '..�.�' '�.�s.' '��<^�' '����q' 'uq..3' '.���*' '.�(�^' '�.yL.' '.ΨI.' 'K��.~' '�Xgt�' '.�ù�' '�`dw�' '.3�wb' '� �߲' '�I$.W' '@����' 'G.�X�' '~[8.�' 'b�>PY' '.�H��' 'L��M.' '8�0.^' '��.\\' 'p+V.�' '{.Xe~' '.�_R�' '�&��' '.v$e�' '.2� '' '.���.' 'ۡ�8(' '. Y�>' 'm.7..' 'Gs��.' '�[.M�' '�.V_.' '-�..�' '���$.' '�<.C.' '..�.�' '��.(�' '���.�' '��A��' '���..' 's.��[' 'Q�.�B' '?$�.�' '�..X;' '�.%.�' '!.E!.' 'XL.�.' '��.wk' 'D.[�?' '.I.��' '.�M.�' '�c:��' '.��I[' '..�l.' '��|<�' '.�gJ.' '�+�.�' '�l.�O' ' �?6.' ']�pK.' 'Ug(��' '[EMAIL PROTECTED]' '../Q.' '���3' '6�_{S' '..F��' '..M.>' '�e~��' '�Х�G' 'yX.'.' '*�A��' '*յ.�' '6�:�' 'p]��N' '��'|�' ':g�(�' 'R[j.�' ' [EMAIL PROTECTED]' 'G�e.�' '.�}c.' '�.��' '�f' '.�..`' 'qS{��' 'OR��' '{z��' '� J�.' '.Z.G.' '�wUm.' '+X�.g' '.�R..') -> dbd_st_execute for 028e2e90 ---> parse_params with statement SELECT RPAD(token, 5, ' '), spam_count, ham_count, atime FROM bayes_token WHERE id = ? AND token IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) num params 101 parse_params slen 364 parse_params statement_ptr 02a50e00 = SELECT RPAD(token, 5, ' '), spam_count, ham_count, atime FROM bayes_token WHERE id = ? AND token IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) statement_ptr_end 02a50f6c [...] <--- parse_params mysql_st_internal_execute Binding parameters: SELECT RPAD(token, 5, ' '), spam_count, ham_count, atime FROM bayes_token WHERE id = '3' AND token IN ('��j�f','�GW��','QJ+�1','���|�','���','▉s','��<^�','����q','uq�3','���*','��(�^','�yL','�ΨI�','K��~','�Xgt�','�ù�','�`dw�','�3�wb','� �߲','�I$�W','@����','G��X�','~[8.�','b�>PY','��H��','L��M�','8�0�^','�Б\\\\','p+V�','{�Xe~','��_R�','�&� �','v$e�','2� \'','���','ۡ�8(','� Y�>','m7�','Gs��','�[M�','��V_�','-��','���$�','�<C�','���','��(�','���','��A��','����','s���[','Q�B','?$��','��X;','�%��','!�E!','XL�','���wk','D�[�?','I���','�M��','�c:��','��I[','��l','��|<�','�gJ�','�+���','�l��O','\r�?6�',']�pK','Ug(��','[EMAIL PROTECTED]','/Q','���3','6�_{S','�F��','�M�>','�e~��','�Х�G','yX\'�','*�A��','*յ�','6�:�','p]��N','��\'|�',':g�(�','R[j�','[EMAIL PROTECTED]','G�e��','��}c','����','�f','�ۏ`','qS{��','OR��','{z�� ','�\nJ�','�ZG','�wUm','+X�g','�R�') <- dbd_st_execute returning imp_sth->row_num 0 <- execute= '0E0' at SQL.pm line 899 -> fetchall_arrayref for DBD::mysql::st (DBI::st=HASH(0x28e2cd0)~0x2a4fc40) -> dbd_st_fetch for 028e2e90, chopblanks 0 <- fetchall_arrayref= [ ] row-1 at SQL.pm line 906 -> finish for DBD::mysql::st (DBI::st=HASH(0x28e2cd0)~0x2a4fc40) <- finish= 1 at SQL.pm line 908 -> DESTROY for DBD::mysql::st (DBI::st=HASH(0x2a4fc40)~INNER) <- DESTROY= undef at SQL.pm line 910 -> prepare for DBD::mysql::db (DBI::db=HASH(0x28d1fe0)~0x28d1ed0 'SELECT RPAD(token, 5, ' '), spam_count, ham_count, atime FROM bayes_token WHERE id = ? AND token IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)') dbd_st_prepare calling count_params (counting params emulation) <- prepare= DBI::st=HASH(0x28e2e70) at SQL.pm line 892 -> execute for DBD::mysql::st (DBI::st=HASH(0x28e2e70)~0x2a4f8c0 '3' '�Z.�R' ' �.N�' '�.~Z�' ' �Lvz' '/.o�g' '.....' '�.��' 'DǍ{.' '...{}' '.Nq5�' '�}. $' '�q�.@' '����<' '`���' '#;Z' '-.+LQ' '8�z�.' 'GD.N.' ' r��7' ' .fr�' 'H;.á' '�.�.�' '.Ϫ�.' '..ط.' '��[.s' '..z��' ';.�E�' 'H�.��' 'h��.�' '.w.��' '�.�x8' '���*�' '<.X��' ',��#�' '��{5�' '�o�\9' '�vu' '.�g�' ' !&�A' '[��.' '�Y��.' '���K�' '.E$C.' '��...' '�*�/�') -> dbd_st_execute for 02a4fd40 ---> parse_params with statement SELECT RPAD(token, 5, ' '), spam_count, ham_count, atime FROM bayes_token WHERE id = ? AND token IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) num params 46 parse_params slen 254 parse_params statement_ptr 02a50e00 = SELECT RPAD(token, 5, ' '), spam_count, ham_count, atime FROM bayes_token WHERE id = ? AND token IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) statement_ptr_end 02a50efe parse_params statement_ptr 02a50e01 = ELECT RPAD(token, 5, ' '), spam_count, ham_count, atime FROM bayes_token WHERE id = ? AND token IN (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) statement_ptr_end 02a50efe [...] <--- parse_params mysql_st_internal_execute Binding parameters: SELECT RPAD(token, 5, ' '), spam_count, ham_count, atime FROM bayes_token WHERE id = '3' AND token IN ('�Z��R','\r�N�','�~Z�','\r�Lvz','/o�g','�\0�','���','DǍ{�','�{}','Nq5�','�}\r$','�q�@','����<','`���','#;Z','-�+LQ','8�zϙ','GD�N�','\nr��7',' �fr�','H;.á','���','Ϫ�','�ط','��[s','z��',';�E�','H都�', 'h��','w���','��x8','���*�','<X��',',��#�','��{5�','�o�\\9','�vu','�g�',' !&�A','[��','�Y��','���K�','E$C�','��\Z','�*�/�') <- dbd_st_execute returning imp_sth->row_num 0 <- execute= '0E0' at SQL.pm line 899 -> fetchall_arrayref for DBD::mysql::st (DBI::st=HASH(0x28e2e70)~0x2a4f8c0) -> dbd_st_fetch for 02a4fd40, chopblanks 0 <- fetchall_arrayref= [ ] row-1 at SQL.pm line 906 -> finish for DBD::mysql::st (DBI::st=HASH(0x28e2e70)~0x2a4f8c0) <- finish= 1 at SQL.pm line 908 -> DESTROY for DBD::mysql::st (DBI::st=HASH(0x2a4f8c0)~INNER) <- DESTROY= undef at SQL.pm line 910 [5205] dbg: bayes: cannot use bayes on this message; none of the tokens were found in the database [5205] dbg: bayes: not scoring message, returning undef [...] Thank you and sorry for the long post. -- Eray