Code: Select all
/etc/cron.daily/eFa-Tokens.cron:
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.
(Rolling back on Rocky Linux is not available).
Code: Select all
/etc/cron.daily/eFa-Tokens.cron:
WARNING: MYSQL_OPT_RECONNECT is deprecated and will be removed in a future version.
We are already testing openeFa, but it seems to me it is not fully useable for us. We need to tweak settings but have no information where and how to. (Mentioned in my previous posts.)adrastosefa wrote: Thu Dec 25, 2025 6:43 am ...
The full contents of
/etc/cron.daily/eFa-Tokens.cronThe output of:Code: Select all
#!/usr/bin/perl # +--------------------------------------------------------------------+ # eFa-Tokens.cron # Expires old tokens from efa database # Version 20210130 # +--------------------------------------------------------------------+ # Copyright (C) 2012~2021 http://www.efa-project.org # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # +--------------------------------------------------------------------+ use strict 'vars'; use strict 'refs'; use DBI; use Sys::Syslog qw( :DEFAULT setlogsock); my($user) = $ENV{'USER'}; setlogsock('unix'); my($db_name) = 'efa'; my($db_host) = 'localhost'; my($db_user) = 'efa'; # Issue #66 Grab Passwords from eFa-Config my($fh); my($pw_config) = '/etc/eFa/eFa-Config'; open($fh, "<", $pw_config); if (!$fh) { openlog($0,'','user'); syslog('error', "Unable to retrieve password from /etc/eFa/eFa-Config, aborting!"); closelog; exit 1; } my($db_pass) = grep(/^EFASQLPWD/,<$fh>); $db_pass =~ s/EFASQLPWD://; $db_pass =~ s/\n//; close($fh); my($sql,$sth,$dbh); # Connect to the database $dbh = DBI->connect("DBI:mysql:database=$db_name;host=$db_host", $db_user, $db_pass, {PrintError => 0}); if ($dbh) { $sql = "DELETE from tokens WHERE datestamp < DATE_SUB(NOW() , INTERVAL 3 DAY)"; $sth = $dbh->prepare($sql); $sth->execute; $sth->finish(); $dbh->disconnect(); openlog($0,'','user'); syslog('info', "Successfully expired old tokens."); closelog; } else { openlog($0,'','user'); syslog('ERR', "Unable to open efa database, tokens not expired!"); closelog; }
mysql --version
rpm -qa | egrep 'mysql|maria|DBD'(Optional but helpful) Which recent update coincided with the warning first appearing.Code: Select all
mysql Ver 15.1 Distrib 10.5.27-MariaDB, for Linux (x86_64) using EditLine wrapper ... perl-DBD-SQLite-1.66-5.el9.x86_64 mariadb-connector-c-config-3.2.6-1.el9_0.noarch mariadb-connector-c-3.2.6-1.el9_0.x86_64 mariadb-common-10.5.27-1.el9_5.0.2.x86_64 mariadb-errmsg-10.5.27-1.el9_5.0.2.x86_64 mariadb-server-utils-10.5.27-1.el9_5.0.2.x86_64 mariadb-backup-10.5.27-1.el9_5.0.2.x86_64 mariadb-10.5.27-1.el9_5.0.2.x86_64 mariadb-gssapi-server-10.5.27-1.el9_5.0.2.x86_64 mariadb-server-10.5.27-1.el9_5.0.2.x86_64 php-mysqlnd-8.0.30-3.el9_6.x86_64 mysql-common-8.0.43-1.el9_6.x86_64 mysql-libs-8.0.43-1.el9_6.x86_64 perl-DBD-MySQL-4.053-1.el9.0.1.x86_64 mysql-selinux-1.0.14-1.el9_6.noarch perl-DBD-MariaDB-1.21-17.el9.x86_64
This will tell us whether the message is coming from:Code: Select all
2025-12-02T11:33:00+0100 SUBDEBUG Installed: mysql-common-8.0.43-1.el9_6.x86_64 2025-12-02T11:33:00+0100 SUBDEBUG Installed: mysql-libs-8.0.43-1.el9_6.x86_64 2025-12-02T11:33:01+0100 SUBDEBUG Upgrade: perl-DBD-MySQL-4.053-1.el9.0.1.x86_64 2025-12-02T11:33:01+0100 SUBDEBUG Upgrade: mysql-selinux-1.0.14-1.el9_6.noarch 2025-12-02T11:33:44+0100 SUBDEBUG Upgraded: mysql-selinux-1.0.13-1.el9_5.noarch 2025-12-02T11:34:05+0100 SUBDEBUG Upgraded: perl-DBD-MySQL-4.050-13.el9.x86_64
the MySQL client library itself,
the Perl DBD driver in use,
or a specific eFA v5 script calling the database layer.
Setting expectations:
Code: Select all
#!/bin/bash
# Script to fix MySQL deprecated reconnect warnings in MailScanner
# Backup all files first
sudo cp /usr/share/MailScanner/perl/custom/MailWatch.pm /usr/share/MailScanner/perl/custom/MailWatch.pm.bak
sudo cp /usr/share/MailScanner/perl/custom/SQLBlackWhiteList.pm /usr/share/MailScanner/perl/custom/SQLBlackWhiteList.pm.bak
sudo cp /usr/share/MailScanner/perl/custom/SQLSpamSettings.pm /usr/share/MailScanner/perl/custom/SQLSpamSettings.pm.bak
sudo cp /usr/share/MailScanner/perl/custom/CustomAction.pm /usr/share/MailScanner/perl/custom/CustomAction.pm.bak
sudo cp /usr/share/MailScanner/perl/MailScanner/ConfigSQL.pm /usr/share/MailScanner/perl/MailScanner/ConfigSQL.pm.bak
sudo cp /usr/share/MailScanner/perl/MailScanner/CustomConfig.pm /usr/share/MailScanner/perl/MailScanner/CustomConfig.pm.bak
sudo cp /usr/share/MailScanner/perl/MailScanner/SA.pm /usr/share/MailScanner/perl/MailScanner/SA.pm.bak
# Fix each file by adding mysql_auto_reconnect=0 to the connection strings
sudo sed -i 's/DBI->connect("DBI:mysql:database=\$db_name;host=\$db_host"/DBI->connect("DBI:mysql:database=$db_name;host=$db_host;mysql_auto_reconnect=0"/g' /usr/share/MailScanner/perl/custom/MailWatch.pm
sudo sed -i 's/DBI->connect("DBI:mysql:database=\$db_name;host=\$db_host"/DBI->connect("DBI:mysql:database=$db_name;host=$db_host;mysql_auto_reconnect=0"/g' /usr/share/MailScanner/perl/custom/SQLBlackWhiteList.pm
sudo sed -i 's/DBI->connect("DBI:mysql:database=\$db_name;host=\$db_host"/DBI->connect("DBI:mysql:database=$db_name;host=$db_host;mysql_auto_reconnect=0"/g' /usr/share/MailScanner/perl/custom/SQLSpamSettings.pm
sudo sed -i 's/DBI->connect("DBI:mysql:database=\$db_name;host=\$db_host"/DBI->connect("DBI:mysql:database=$db_name;host=$db_host;mysql_auto_reconnect=0"/g' /usr/share/MailScanner/perl/custom/CustomAction.pm
sudo sed -i 's/DBI->connect("DBI:mysql:mailscanner:192.168.0.51"/DBI->connect("DBI:mysql:mailscanner:192.168.0.51;mysql_auto_reconnect=0"/g' /usr/share/MailScanner/perl/MailScanner/CustomConfig.pm
echo "All files backed up and patched!"
This is also valid when you release a message and mark it as ham.Woger wrote: Mon Jan 05, 2026 4:04 pm I made this script to get rid of these errors in the logs. However, it still gives this error when I manually tag a mail as spam.