After a new installation I am facing errors in the maillog referring to mailscanner as information below.
[root@efa custom]# MailScanner --lint
Trying to setlogsock(unix)
Could not use Custom Function code /usr/share/MailScanner/perl/custom/CustomAction.pm, it could not be "require"d. Make sure the last line is "1;" and the module is correct with perl -wc (Error: Global symbol "$year" requires explicit package name at /usr/share/MailScanner/perl/custom/CustomAction.pm line 154.
Global symbol "$mon" requires explicit package name at /usr/share/MailScanner/perl/custom/CustomAction.pm line 154.
Global symbol "$mday" requires explicit package name at /usr/share/MailScanner/perl/custom/CustomAction.pm line 154.
Global symbol "$hour" requires explicit package name at /usr/share/MailScanner/perl/custom/CustomAction.pm line 154.
Global symbol "$min" requires explicit package name at /usr/share/MailScanner/perl/custom/CustomAction.pm line 154.
Global symbol "$sec" requires explicit package name at /usr/share/MailScanner/perl/custom/CustomAction.pm line 154.
Compilation failed in require at /usr/share/MailScanner/perl/MailScanner/Config.pm line 752.
) at /usr/share/MailScanner/perl/MailScanner/Config.pm line 754.
CustomAction.pm
# Version 20210130
# +---------------------------------------------------+
# # Function to create a pseudorandom 32 char token
# # +---------------------------------------------------+
sub randomtoken {
my $message = @_;
my ($token, $sha1);
$sha1 = Digest::SHA->new(1);
my ($timestamp) = sprintf("%d-%02d-%02d %02d:%02d:%02d", $year + 1900, $mon + 1, $mday, $hour, $min, $sec);
$sha1->add($message->{id}, $timestamp, $message->{size}, $message->{headers});
$token = $sha1->hexdigest;
return $token;
}
Other cases reported in other forums
https://github.com/E-F-A/v4/issues/281
https://github.com/E-F-A/v4/issues/282
eFa-4.0.4 - MailScanner version 5.4.1 / CustomAction.pm Global symbol "$year"
- shawniverson
- Posts: 3649
- Joined: 13 Jan 2014 23:30
- Location: Indianapolis, Indiana USA
- Contact:
Re: eFa-4.0.4 - MailScanner version 5.4.1 / CustomAction.pm Global symbol "$year"
4.0.4-5 yanked from repos and 4.0.4-6 going out with fix.
In the meantime...
In the meantime...
Code: Select all
sudo rm -f /usr/share/MailScanner/perl/custom/CustomAction.pm
sudo systemctl restart mailscanner
Re: eFa-4.0.4 - MailScanner version 5.4.1 / CustomAction.pm Global symbol "$year"
Mailscanner started without errors
Does this file interfere with some MailScanner operation functionality?
Does this file interfere with some MailScanner operation functionality?
- shawniverson
- Posts: 3649
- Joined: 13 Jan 2014 23:30
- Location: Indianapolis, Indiana USA
- Contact:
Re: eFa-4.0.4 - MailScanner version 5.4.1 / CustomAction.pm Global symbol "$year"
It does not. If MailScanner is starting okay you are fine and this will resolve itself in the next update.
Re: eFa-4.0.4 - MailScanner version 5.4.1 / CustomAction.pm Global symbol "$year"
Thank you very much.
It's OK.
It's OK.