• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue Spamassassin's sa-compile and Mail::SpamAssassin::CompiledRegexp missing

tkalfaoglu

Silver Pleskian
Hi.. My new server's obsidian on Centos 8 came without the sa-compile binary.

Well, I copied it from the old server and compiled the spamassassin headers.
However, upon starting spamd complains of:

Can't locate Mail/SpamAssassin/CompiledRegexps/body_0.pm in @INC (you may need to install the Mail::SpamAssassin::CompiledRegexps:
:body_0 module) (@INC contains: /var/lib/spamassassin/compiled/5.026/3.004004 /var/lib/spamassassin/compiled/5.026/3.004004/auto lib /usr/share/perl5/vendor_perl /usr
/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at (eval 1948) line 1.


I tried a few CPAN commands, like install Mail::SpamAssassin::CompiledRegexps , but they all failed. Is there a correct way to enable compiled rules?

Many thanks, -turgut
 
SOLVED -- I simply wrote a two-liner...

Code:
PERL_MM_OPT='' sa-compile -D
cp -R /root/perl5/var/spamassassin/compiled/* /var/lib/spamassassin/compiled/

PS: Make sure to enable
Code:
loadplugin Mail::SpamAssassin::Plugin::Rule2XSBody

in the /etc/mail/spamassassin/local.cf
 
Don't copy the binary across servers. Just install the proper package. I'm guessing that you are on Debian or Ubuntu as it has its own package:

Code:
apt-get install sa-compile
 
Sorry I understand. I guess Redhat decided to remove it from the default spamassassin package that comes with the OS.
 
Had the same error on my...
OS: Ubuntu 20.04.5 LTS | Product: Plesk Obsidian 18.0.49

This is how the error looks like in the logfile (/var/log/mail.err):

Bash:
Feb 16 08:34:26 hosting spamc[98110]: connect to spamd on ::1 failed, retrying (#1 of 3): Connection refused
Feb 16 09:10:15 hosting spamd[116009]: Can't locate Mail/SpamAssassin/CompiledRegexps/body_neg2000.pm in @INC
 (you may need to install the Mail::SpamAssassin::CompiledRegexps::body_neg2000 module) (@INC contains:
 /var/lib/spamassassin/compiled/5.030/3.004004 /var/lib/spamassassin/compiled/5.030/3.004004/auto
 /usr/share/perl5 /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.30.0 /usr/local/share/perl/5.30.0 
/usr/lib/x86_64-linux-gnu/perl5/5.30 
/usr/lib/x86_64-linux-gnu/perl/5.30 /usr/share/perl/5.30 /usr/local/lib/site_perl 
/usr/lib/x86_64-linux-gnu/perl-base) at (eval 1969) line 1.


Seams the service is running and working..
Bash:
systemctl status spamassassin.service
● spamassassin.service - Perl-based spam filter using text analysis
     Loaded: loaded (/lib/systemd/system/spamassassin.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2023-02-16 09:10:16 CET; 2s ago
    Process: 116005 ExecStart=/usr/sbin/spamd -d --pidfile=/run/spamd.pid $OPTIONS (code=exited, status=0/SUCCESS)
   Main PID: 116009 (spamd)
      Tasks: 3 (limit: 154344)
     Memory: 113.5M

The mentioned package is already installed:
Bash:
apt-get install sa-compile
Reading package lists... Done
Building dependency tree
Reading state information... Done
sa-compile is already the newest version (3.4.4-1ubuntu1.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Also tried to enter the following in /etc/mail/spamassassin/local.cf without success.

Bash:
loadplugin Mail::SpamAssassin::Plugin::Rule2XSBody

Found this Post on a German speaking Website Linux: SpamAssassin Can't locate CompiledRegexps - Maffert.net and was able to fix the Problem!

This is what I did:
Bash:
# Checking if the packages are installed
sudo apt install re2c sa-compile

# Update and compile the SpamAssassin Rules
sa-update
sa-compile

# Restart SpamAssassin service
systemctl restart spamassassin.service

# Check if the error is still present
tail -f /var/log/maillog
tail -f /var/log/mail.err

Actually I also remove
Code:
loadplugin Mail::SpamAssassin::Plugin::Rule2XSBody
from /etc/mail/spamassassin/local.cf - seams this is not needed in any case.


It is what I see (in /var/log/maillog) now when the spamassissin.service is restarted:
Bash:
Feb 16 09:38:58 hosting spamd[130025]: spamd: server killed by SIGTERM, shutting down
Feb 16 09:38:58 hosting spamd[130370]: logger: removing stderr method
Feb 16 09:38:59 hosting spamd[130374]: zoom: able to use 405/405 'body_0' compiled rules (100%)
Feb 16 09:39:00 hosting spamd[130374]: spamd: server started on IO::Socket::IP [127.0.0.1]:783 (running version 3.4.4)
Feb 16 09:39:00 hosting spamd[130374]: spamd: server pid: 130374
Feb 16 09:39:00 hosting spamd[130374]: spamd: server successfully spawned child process, pid 130378
Feb 16 09:39:00 hosting spamd[130374]: spamd: server successfully spawned child process, pid 130379
Feb 16 09:39:00 hosting spamd[130374]: prefork: child states: IS
Feb 16 09:39:00 hosting spamd[130374]: prefork: child states: II



...looks good to me.
 
This is what I did:
Bash:
# Checking if the packages are installed
sudo apt install re2c sa-compile

# Update and compile the SpamAssassin Rules
sa-update
sa-compile

# Restart SpamAssassin service
systemctl restart spamassassin.service
Thanks!
this fixed it for me too on Ubuntu 20.04, Plesk 18.0.50 Update #2
 
Back
Top