API ID in header or similar

tbtbuk

New Member
Aug 30, 2021
1
0
1
37
Hi All,

We've built a custom inhouse spam filter which is working as a custom script well. However, we'd like our third party tool to be able to release emails from quarantine after a while (other checks have to happen first), however our script isnt aware of the ID that gets set (looks like C1R1465***), seems to be different to the MSGID etc, so we can't pass that over to our check to use the API to release it. I guess we could filter all emails at the set time it came in to release, but there are a lot of downsides to that. So I was wondering, how does that C1..... ID get set for the API, and can I add it to a header in the email (to parse and find) or access it another way in our custom script?

Thanks for any assistance.

Tom
 
however our script isnt aware of the ID that gets set (looks like C1R1465***), seems to be different to the MSGID etc,
the id is in the form 'CXRYYYYYTZZZZZZZ' (X represents the pmg clusternode - YYYYYY is a number from a postgres sequence and ZZZZZZZZ is a timestamp) - it is not available at the time the custom check script runs (the script provides information for the rulesystem in form of spam-points or virus information - and the rule system later creates this id, if the mail is put into quarantine.

You could get the potential mails via REST-API - usually the returned fields from:
https://pmg.proxmox.com/pmg-docs/api-viewer/index.html#/quarantine/spam
should be enough to uniquely identify a mail and then release it

Else you could get the complete message content via the REST-API and match the message-id headers of the original mail to the one:
https://pmg.proxmox.com/pmg-docs/api-viewer/index.html#/quarantine/content

In both cases this should happen outside of the custom check script.

I hope this helps!
 

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!