eFa-4.0.4 - MailScanner version 5.4.1 / CustomAction.pm Global symbol "$year"

Bugs in eFa 4
Post Reply
rgwald
Posts: 4
Joined: 03 Feb 2021 20:06

eFa-4.0.4 - MailScanner version 5.4.1 / CustomAction.pm Global symbol "$year"

Post by rgwald »

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
User avatar
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"

Post by shawniverson »

4.0.4-5 yanked from repos and 4.0.4-6 going out with fix.

In the meantime...

Code: Select all

sudo rm -f /usr/share/MailScanner/perl/custom/CustomAction.pm
sudo systemctl restart mailscanner
rgwald
Posts: 4
Joined: 03 Feb 2021 20:06

Re: eFa-4.0.4 - MailScanner version 5.4.1 / CustomAction.pm Global symbol "$year"

Post by rgwald »

Mailscanner started without errors
Does this file interfere with some MailScanner operation functionality?
User avatar
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"

Post by shawniverson »

It does not. If MailScanner is starting okay you are fine and this will resolve itself in the next update.
rgwald
Posts: 4
Joined: 03 Feb 2021 20:06

Re: eFa-4.0.4 - MailScanner version 5.4.1 / CustomAction.pm Global symbol "$year"

Post by rgwald »

Thank you very much.
It's OK.
Post Reply