[SOLVED] SPAM DETECTOR not Working

max046

New Member
Feb 26, 2024
24
3
3
Good day!
Proxmox - Spam detector - Custom Scores. The correlation rules do not work. How to fix this?
1727069456818.png

In current emails that end up in spam
1727069615682.png
 
Hello,

Just to be sure to not miss the obvious here: you did indeed apply the changes using the Apply button in the "diff" panel at the bottom of the Custom Scores tab?
 
Hello,

Just to be sure to not miss the obvious here: you did indeed apply the changes using the Apply button in the "diff" panel at the bottom of the Custom Scores tab?
Yes, sure. and tried to restart various services, and tried to reboot the host, but for some reason the correlation does not apply
 
Yes, sure. and tried to restart various services, and tried to reboot the host, but for some reason the correlation does not apply
* how does the file `/etc/mail/spamassassin/pmg-scores.cf` look on your system?
* what's the output of `spamassassin -Dall --lint 2>&1 |grep pmg-scores` ?
 
* how does the file `/etc/mail/spamassassin/pmg-scores.cf` look on your system?
* what's the output of `spamassassin -Dall --lint 2>&1 |grep pmg-scores` ?
Good day, Stoiko

spamassassin -Dall --lint 2>&1 |grep pmg-scores:
1727758969064.png
but the pmg-scores.cf file is empty. What needs to be added to this file?
 
but the pmg-scores.cf file is empty. What needs to be added to this file?
this is the file where the custom scores are written once you apply the changes you did in the GUI as @t.lamprecht pointed out.
try changing a score (or adding a 0 score for a bogus rule) and clicking Apply again) - check the journal and /var/log/pmgproxy/pmgproxy.log to make sure there is no error in that part.
 
this is the file where the custom scores are written once you apply the changes you did in the GUI as @t.lamprecht pointed out.
try changing a score (or adding a 0 score for a bogus rule) and clicking Apply again) - check the journal and /var/log/pmgproxy/pmgproxy.log to make sure there is no error in that part.
As I said, I save the changes in the GUI, but for some reason they are not made to /etc/mail/spamassassin/pmg-scores.cf
1727769444594.png
/var/log/pmgproxy.log:
[01/10/2024:10:50:39 +0300] "POST /api2/json/access/ticket HTTP/1.1" 200 502
[01/10/2024:10:51:09 +0300] "GET /api2/json/config/ruledb/digest HTTP/1.1" 200 51
[01/10/2024:10:51:14 +0300] "GET /api2/json/config/ruledb/digest HTTP/1.1" 200 51
[01/10/2024:10:51:40 +0300] "PUT /api2/extjs/config/customscores HTTP/1.1" 200 95
[01/10/2024:10:51:40 +0300] "GET /api2/json/nodes/10-vm-pmg02/tasks/UPID%3A10-vm-pmg02%3A002DDC66%3A27AB1172%3A66FBAA0C%3Aapplycustomscores%3A%3Aroot%40pam%3A/status HTTP/1.1" 200 241
[01/10/2024:10:51:42 +0300] "GET /api2/json/nodes/10-vm-pmg02/tasks/UPID%3A10-vm-pmg02%3A002DDC66%3A27AB1172%3A66FBAA0C%3Aapplycustomscores%3A%3Aroot%40pam%3A/status HTTP/1.1" 200 241
[01/10/2024:10:51:43 +0300] "GET /api2/json/nodes/10-vm-pmg02/tasks/UPID%3A10-vm-pmg02%3A002DDC66%3A27AB1172%3A66FBAA0C%3Aapplycustomscores%3A%3Aroot%40pam%3A/status HTTP/1.1" 200 241
[01/10/2024:10:51:44 +0300] "GET /api2/json/nodes/10-vm-pmg02/tasks/UPID%3A10-vm-pmg02%3A002DDC66%3A27AB1172%3A66FBAA0C%3Aapplycustomscores%3A%3Aroot%40pam%3A/status HTTP/1.1" 200 241
[01/10/2024:10:51:45 +0300] "GET /api2/json/nodes/10-vm-pmg02/tasks/UPID%3A10-vm-pmg02%3A002DDC66%3A27AB1172%3A66FBAA0C%3Aapplycustomscores%3A%3Aroot%40pam%3A/status HTTP/1.1" 200 241
[01/10/2024:10:51:46 +0300] "GET /api2/json/nodes/10-vm-pmg02/tasks/UPID%3A10-vm-pmg02%3A002DDC66%3A27AB1172%3A66FBAA0C%3Aapplycustomscores%3A%3Aroot%40pam%3A/status HTTP/1.1" 200 259
[01/10/2024:10:51:46 +0300] "GET /api2/extjs/config/customscores?_dc=1727769106250 HTTP/1.1" 200 612
[01/10/2024:10:51:53 +0300] "GET /api2/json/config/ruledb/digest HTTP/1.1" 200 51
 
[01/10/2024:10:51:40 +0300] "PUT /api2/extjs/config/customscores HTTP/1.1" 200 95
This call should apply the custom scores (and the diff should then vanish from the bottom of the page...)
Tested this here - and it works reliably

after applying the scores - what's the content (if the file exist) of:
* /var/cache/pmg-scores.cf
* /etc/mail/spamassassin/pmg-scores.cf
also - do you see any issues in the system-journal when you apply the scores?
 
This call should apply the custom scores (and the diff should then vanish from the bottom of the page...)
Tested this here - and it works reliably

after applying the scores - what's the content (if the file exist) of:
* /var/cache/pmg-scores.cf
* /etc/mail/spamassassin/pmg-scores.cf
also - do you see any issues in the system-journal when you apply the scores?
using the example of adding a MIXED_ES rule with a score of 1

1.created a rule
1727777157369.png
the contents of the /var/cache/pmg-scores.cf file changes to:
1727777277676.png

2. In the GUI I execute apply
1727777349300.png

the /var/cache/pmg-scores.cf file is not cleared and the /etc/mail/spamassassin/pmg-scores.cf file remains unchanged
1727777551657.png
 
any messages in the system journal? (see `man journalctl`)
 
please post text as text (in a code block) instead of screenshots

else - please post the output of `mount` and `ls -la /var/cache`, and `pmgversion -v` (as text in code blocks)

how was the PMG setup? (install from ISO, is it a container running on PVE, was it installed on top of a Debian GNU/Linux installation?)
 
please post text as text (in a code block) instead of screenshots

else - please post the output of `mount` and `ls -la /var/cache`, and `pmgversion -v` (as text in code blocks)

how was the PMG setup? (install from ISO, is it a container running on PVE, was it installed on top of a Debian GNU/Linux installation?)
was it installed on top of a Debian GNU/Linux installation

root@10-vm-pmg02:~# mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=4029728k,nr_inodes=1007432,mode=755,inode64)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=812332k,mode=755,inode64)
/dev/mapper/mhb--vm--pmg01--vg-root on / type ext4 (rw,relatime,errors=remount-ro)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k,inode64)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=18985)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
ramfs on /run/credentials/systemd-sysctl.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
ramfs on /run/credentials/systemd-sysusers.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
ramfs on /run/credentials/systemd-tmpfiles-setup-dev.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
/dev/sda1 on /boot type ext2 (rw,relatime)
/dev/mapper/vgvar-lvvar on /var type ext4 (rw,relatime,errors=remount-ro)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
ramfs on /run/credentials/systemd-tmpfiles-setup.service type ramfs (ro,nosuid,nodev,noexec,relatime,mode=700)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=812328k,nr_inodes=203082,mode=700,inode64)
root@10-vm-pmg02:~# ls -la /var/cache/
итого 52
drwxr-xr-x 12 root root 4096 окт 1 13:02 .
drwxr-xr-x 12 root root 4096 мар 12 2024 ..
drwxr-xr-x 2 root root 4096 мая 25 2023 adduser
drwxr-xr-x 3 root root 4096 окт 1 03:44 apt
drwxr-xr-x 3 root root 4096 мар 20 2024 debconf
drwxr-xr-x 2 root root 4096 мар 11 2024 dictionaries-common
drwxr-xr-x 2 root root 4096 мар 11 2024 fontconfig
drwx------ 2 root root 4096 мар 21 2024 ldconfig
drwxr-xr-x 34 man man 4096 окт 1 10:58 man
-rw-r--r-- 1 root root 21 окт 1 13:02 pmg-scores.cf
drwxr-xr-x 3 root root 4096 мар 11 2024 postgresql
drwx------ 2 root root 4096 мар 11 2024 private
drwxr-xr-x 2 root root 4096 ноя 3 2022 razor
root@10-vm-pmg02:~# pmgversion -v
proxmox-mailgateway: 8.1.0 (API: 8.1.2/c979cfd1d78a, running kernel: 6.5.13-1-pve)
pmg-api: 8.1.2
pmg-gui: 4.1.1
proxmox-kernel-helper: 8.1.0
proxmox-kernel-6.5.13-1-pve-signed: 6.5.13-1
proxmox-kernel-6.5: 6.5.13-1
clamav-daemon: 1.0.3+dfsg-1~deb12u1
ifupdown: residual config
ifupdown2: 3.2.0-1+pmx8
libarchive-perl: 3.6.2
libjs-extjs: 7.0.0-4
libjs-framework7: 4.4.7-2
libproxmox-acme-perl: 1.5.0
libproxmox-acme-plugins: 1.5.0
libpve-apiclient-perl: 3.3.0
libpve-common-perl: 8.1.0
libpve-http-server-perl: 5.0.5
libxdgmime-perl: 1.1.0
lvm2: 2.03.16-2
pmg-docs: 8.1.1
 
Thanks for the information - I think I found the issue - your PMG has /var on a separate filesystem - and the moving of the file does currently not work across filesystem boundaries - I prepared a patch to address this:
https://lore.proxmox.com/pmg-devel/20241002172238.20947-1-s.ivanov@proxmox.com/T/#u

once this or an improved version has been applied and released applying the custom scores will also work for your installation!

Thanks for the report!!
 
Thanks for the information - I think I found the issue - your PMG has /var on a separate filesystem - and the moving of the file does currently not work across filesystem boundaries - I prepared a patch to address this:
https://lore.proxmox.com/pmg-devel/20241002172238.20947-1-s.ivanov@proxmox.com/T/#u

once this or an improved version has been applied and released applying the custom scores will also work for your installation!

Thanks for the report!!
Thank you, can you tell me how to install this patch?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!