[SOLVED] API Mails in quarantine

Mar 4, 2019
11
0
1
38
Hello,
when I use /usr/bin/pmgsh get /quarantine/spamstatus the count variable is wrong. It shows 10 messages in spam but in the webfrontend no mails are shown. pmgversion is "pmg-api/5.2-7/9943bd5d".
 
the api call counts the complete database, while the gui by default only shows the last week, maybe you have mails in the quarantine before that?
 
That was my first thought. So I selected a whole year and there is nothing. In the /var/spool/pmg/cluster/1/spam are the ten mails but they are already deleted/send over the GUI.
 
ok i investigated a little and it seem that api call counts all mails in the spam quarantine that are not completely deleted, which are all mails which fall in the spam quarantine lifetime
so we only remove the mails for real as soon as they are older than the quarantine lifetime, reason being that one mail can have multiple recipients, making it hard to track, and also
all valid spam reports (those not older than the lifetime) have valid deliver/Whitelist/blacklist/delete links...
 
not directly no, you can list the users for which there quarantined mails with /quarantine/spamusers
and list those quarantined mails with /quarantine/spam

what exactly do you need this for?

you can of course file an enhancment request here: https://bugzilla.proxmox.com/
(no promises though)
 
That helped a lot. Backround: All mails with compressed attachments are moved into the quarantine. So the it deparmend has to be informed when a new mail is in quarantine. For monitoring we use Zabbix. So my new item looks like this:

Code:
UserParameter=pmg.quarantine.spamcount,/usr/bin/sudo /usr/bin/pmgsh get /quarantine/spamusers 2>/dev/null | grep @ | wc -l
 

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!