E-F-A/v4

CustomAction.pm line 155

Closed this issue · 5 comments

Hi,

centos 7 - up-to-date
efa 4.0.4, mailscanner 5.4.1
mailscanner conf: Spam Actions = store custom(spam)

maillog:
MailScanner[38506]: Calling CustomAction returned Can't use string ("1") as a HASH ref while "strict refs" in use at /usr/share/MailScanner/perl/custom/CustomAction.pm line 155.

No messages "recipient spam report" ( release link/massage) going out to recipient.

Thanks

I have found the source of this problem:
when calling the function EFACreateToken, $message is never passed.
Lines 73 and 136:
$token = EFACreateToken();
should be:
$token = EFACreateToken($message);

The declaration of local $message is also incorrect in both EFACreateToken and randomtoken:
Lines 86 and 151:
my $message = @_;
should be:
my ($message) = @_;

I must also point out that the generated token is 40 characters long, but the MariaDB column is defined as 20 characters.
The php script for release (eFa-release.php) also expects a 20 characters token.

My solution is truncating the token before returning from randomtoken:
Line 157:
return substr($token, 0, 20);

Fixed in commit 032e366

Hi @shawniverson,

I just had an issue where a user click on the link to release a message from a Spam not delivered email, the efa-release.php page immediately redirected to login.php?error=pagetimeout page without releasing the message.

After seeing this closed issue and some investigation, I found that the function validateInput($token, 'releasetoken') (line 45 in efa-release.php) is still expecting a 20 characters input.

By going into functions.php file and change line 4551 from:
if (preg_match('/^[0-9A-Fa-f]{20}$/', $input)) {
To:
if (preg_match('/^[0-9A-Fa-f]{40}$/', $input)) {

The issue is now fixed and users can now release the message. Not sure if this was just an issue with my EFA installation so I apologize before hand.

Fixed in commit 751488b