Closed bogdanrotariu closed 1 year ago
Thank you for submitting your first issue to MailScanner! We will respond to you soon!
Tests on my instance with latest MailScanner aren't definitive. I'm not reproducing the loop, but I'm not sure that I am producing the same conditions to trigger the problem. Going to leave unconfirmed for now and keep investigating.
We hit the same issue running MailScanner 5.3.3 on WHM with MSFE/ConfigServer, using EXIM MTA
I enabled debug logging and found the following error:
Not an ARRAY reference at /usr/mailscanner/usr/share/MailScanner/perl/MailScanner/Message.pm line 753.
Checking the Message.pm, I found that it was calling the postfix section of the code, instead of exim. I manually changed the code to the following, replacing == to eq:
MailScanner::Log::InfoLog("TESTING MTA: %s | %s", MailScanner::Config::Value('mta'), MailScanner::Config::Value('spamlistskipifauthenticated'));
MailScanner::Log::InfoLog("TESTING MTA == POSTFIX = %s", (MailScanner::Config::Value('mta') == "postfix"));
MailScanner::Log::InfoLog("TESTING MTA eq POSTFIX = %s", (MailScanner::Config::Value('mta') eq "postfix"));
my $isauthenticated = 0;
if (MailScanner::Config::Value('mta') eq "postfix" && MailScanner::Config::Value('spamlistskipifauthenticated')) {
# MailScanner::Log::InfoLog(Dumper($metadata));
# Test if sender is authenticated on mta
MailScanner::Log::InfoLog("TESTING POSTFIX SKIP");
foreach my $metadata (@{$this->{metadata}}) {
#Postfix
if ($metadata =~ m/^Asasl_method=(PLAIN|LOGIN)$/) {
MailScanner::Log::InfoLog("Sender was authenticated - Not checking RBLs");
$isauthenticated = 1;
}
}
} elsif (MailScanner::Config::Value('mta') eq "exim" && MailScanner::Config::Value('spamlistskipifauthenticated')) {
MailScanner::Log::InfoLog("TESTING EXIM SKIP");
if (exists $this->{metadata}->{dv_auth_id}) {
MailScanner::Log::InfoLog("Sender was authenticated - Not checking RBLs");
$isauthenticated = 1;
}
}
MailScanner::Log::InfoLog("Success AFTER");
SYSLOG:
Nov 10 01:45:22 server MailScanner: TESTING MTA: exim | 1
Nov 10 01:45:22 server MailScanner: TESTING MTA == POSTFIX = 1
Nov 10 01:45:22 server MailScanner: TESTING MTA eq POSTFIX = 0
Nov 10 01:45:22 server MailScanner: TESTING EXIM SKIP
Nov 10 01:45:22 server MailScanner: Sender was authenticated - Not checking RBLs
Nov 10 01:45:22 server MailScanner: TESTING AFTER
And everything is running as expected. I am not familiar with Perl so I can't help much.
We are using MSFE from configserver and MailScanner version 5.3.3. When we enable Check SpamAssassin If On Spam List = yes in the config, the MailScanner starts on looping while scanning the messages and eventually MailScanner dies. Disabling the option fixes the issue.
This is the configuration we use: