Unescaped left brace in regex is deprecated sa-learn error

km9

Active Member
Apr 5, 2017
33
7
8
Asia
cPanel Access Level
Root Administrator
I've been getting an error on running the spamassassin sa-learn script on emails to learn spam:

Code:
Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/(?is)spam title here claim.{1,10}your.gbp|won.you.{ <-- HERE 1,10]gbp)/ at /usr/local/cpanel/3rdparty/perl/528/lib/perl5/cpanel_lib/Mail/SpamAssassin/Conf/Parser.pm line 1403.
(Note the curly bracket followed by a square bracket syntax error): "won.you.{1,10]gbp"

I don't have WHM access on this server, but I've checked the /etc/mail/spamassassin/KAM.cf file, and the syntax there is also incorrect:

Code:
find / -iname kam.cf

/etc/mail/spamassassin/KAM.cf
Code:
grep "1,10]gbp" /etc/mail/spamassassin/KAM.cf

body        __KAM_LOTTO5    /spam title here claim.{1,10}your.gbp|won.you.{1,10]gbp)/is
I've spoken with the support team for this particular server, but they seem nonplussed by this problem. How do I explain how to update this KAM.cf to a version without this syntax error?

Thanks.

Edit: Yes, I do mean "/etc/mail/spamassassin/KAM.cf" (not /usr/local/cpanel/etc/mail/spamassassin/KAM.cf)
 
Last edited by a moderator:

km9

Active Member
Apr 5, 2017
33
7
8
Asia
cPanel Access Level
Root Administrator
Actually, I think that this is the key: I do mean "/etc/mail/spamassassin/KAM.cf" (not /usr/local/cpanel/etc/mail/spamassassin/KAM.cf)

I did 'ls -la /etc/mail/spamassassin' and got this:


Code:
total 364
drwxr-xr-x. 3 root root   4096 Oct  4 04:09 .
drwxr-xr-x. 3 root root   4096 May  9  2014 ..
-rw-r--r--  1 root root    748 Dec  4  2015 BAYES_POISON_DEFENSE.cf
-rw-r--r--  1 root root   4231 Aug 30  2016 CPANEL.cf
-rw-r--r--  1 root root  22964 Sep 24  2018 deadweight.cf
-rw-r--r--  1 root root   1289 Feb  8  2019 init.pre
-rw-r--r--  1 root root 285164 Dec  4  2015 KAM.cf
-rw-r--r--  1 root root   1349 Mar 18  2019 kam_heavyweights.cf
-rwx------  1 root root    348 Feb  8  2019 kill-spamd.sh
-rw-r--r--. 1 root root   2824 May  4  2017 local.cf
-rw-r--r--  1 root root   3504 Dec  4  2015 P0f.cf
drwx------. 2 root root   4096 Oct  3 04:37 sa-update-keys
lrwxrwxrwx  1 root root     59 May  9  2018 user_prefs.template -> /usr/local/cpanel/etc/mail/spamassassin/user_prefs.template
-rw-r--r--  1 root root   2524 Feb  8  2019 v310.pre
-rw-r--r--  1 root root   1194 Feb  8  2019 v312.pre
-rw-r--r--. 1 root root   2412 Feb 12  2017 v320.pre
-rw-r--r--  1 root root   1237 Feb  8  2019 v330.pre
Note there's only 1 file that is a link, and the KAM.cf dates from 2015. I believe every entry except init.pre, kill-spamd.sh, local.cf, sa-update-keys and the four *.pre files should be linked to /usr/local/cpanel/etc/mail/spamassassin/...

So now the question is: how can this directory be corrected? I thought it might be checked during the cpanel update?
 

km9

Active Member
Apr 5, 2017
33
7
8
Asia
cPanel Access Level
Root Administrator
Lots of views, but no suggestions as to how this directory became corrupted, or how to put it right?

(Thanks to the moderators for changing the title of this thread, I actually thought that the original subject referencing KAM.cf directly was more apt though, in this case)
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
Hi @km9

There should definitely be symlinks there - and there should be updated information. The cPanel update would normally encompass this. Can you show me the output of the following
Code:
cat /etc/cpanelsync.exclude
Code:
cat /etc/cpupdate.conf
 

km9

Active Member
Apr 5, 2017
33
7
8
Asia
cPanel Access Level
Root Administrator
Hi, thanks for the interest, but I don't have root access to this machine, and I persuaded the support team to reinstate the links manually:

Code:
ln -sf /usr/local/cpanel/etc/mail/spamassassin/BAYES_POISON_DEFENSE.cf /etc/mail/spamassassin/
ln -sf /usr/local/cpanel/etc/mail/spamassassin/CPANEL.cf /etc/mail/spamassassin/
ln -sf /usr/local/cpanel/etc/mail/spamassassin/KAM.cf /etc/mail/spamassassin/
ln -sf /usr/local/cpanel/etc/mail/spamassassin/P0f.cf /etc/mail/spamassassin/
Which solved the problem.

Neither of those files exist though:

(cat: /etc/cpanelsync.exclude: No such file or directory,
cat: /etc/cpanelsync.exclude: No such file or directory)
 
  • Like
Reactions: cPanelLauren