On 8/25/18 7:05 PM, David Newman wrote: >> The SQL lookup result is 0, and SA required_score for tagging is then 0. >> Perhaps, something is wrong with values in your SQL policy table, wrong data >> type?
Again answering my own post: After a lot of searching, I found reports of a previously known type-conversion bug in the Perl DBD-MySQL module (aka p5-DBD-mysql on FreeBSD): https://github.com/perl5-dbi/DBD-mysql/issues/78 https://lists.amavis.org/pipermail/amavis-users/2016-December/004674.html This explains why user amavisd gets correct results in the MySQL client but iRedMail lookups get incorrect (0) results via the p5-DBD-mysql module. This was fixed, and then reverted. Arrrgh. My options are these: 1. Revert to the old p5-DBD-mysql-4.037 module, the last version not to have the type-conversion bug. I have verified that this version does not have the type-conversion bug, and returns expected values from MySQL lookups. However, this is a quite old version (current on FreeBSD is 4.046) and has several other security vulnerabilities. 2. Switch away from MySQL or MariaDB to PostgreSQL, which are also supported by iRedMail. It also supports OpenLDAP, but's that's not an option for me as I don't know it. I am hardly an SQL expert, and even switching between SQL databases is something like changing engines on a jet airline while it's in the air. 3. Stay on the current broken 4.046 module and live with a some false positives. 4. Try to patch the current version and hope the patch doesn't break something else. And then re-patch for every version bump until it gets fixed upstream. None of these options are ideal. Which would you recommend? Thanks dn
