Custom Spam Filter

SomeEmailMan

New Member
Aug 25, 2021
2
0
1
34
Hi All,

I'm looking to implement some custom code to filter out all incoming emails in accordance to our company policies and integrate it with our CRM.

I've found a section in 4.11 of the admin guide detailing a custom bash script.
However I'm having difficulties extracting the email id which is generated by proxmox (so i can ping the http api and approve or deny based on some rules in my companies crm)

Can anyone point me in the right direction please?

Thanks,
Thomas
 
However I'm having difficulties extracting the email id which is generated by proxmox
which id do you mean exactly (quite a few come to mind when I think about e-mails).
the message-id in the mails should be in the queuefile (which you get as second parameter) as part of the mail headers

could you maybe show us an example?

also out of curiosity - which kind of rules do you have in your CRM that need/are helpful in integrating with an anti-spam/virus mailgateway?


Thanks!
 
I want to grab the id which is used when releasing emails from the quarantine through the http api.
There's a quite tight integration between the quarantine and all incoming emails so would be useful to get that email id.

So if i can either interact with proxmox's internal DB or inject the email Id generated into the script execution in the custom filter file.

The rules are dynamic depending on time of day and which of our team are on call (using the same email address, definitely a better way to complete this - unfortunately I'm bound by the constrictions of our existing setup which i can't change)
 
releasing emails from the quarantine through the http api.
you mean the id in the form 'CXRYYYYYTZZZZZZZ' (X represents the pmg clusternode - YYYYYY is a number from a postgres sequence and ZZZZZZZZ is a timestamp) ? if yes -than that's 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)

So if i can either interact with proxmox's internal DB or inject the email Id generated into the script execution in the custom filter file.
you can interact with the database - though there is no guarantee to the stability of the tables/queries (we try our best not to change them unnecessarily, but sometimes a change might be necessary)
In general I'm not sure that PMG is the correct tool for your project...

Maybe the When Objects can be used to create rules for the daytime - but I'm still unsure what you mean by a team having one e-mail address and it depending on who is on call what happens with the mail...

In my experience a ticketing system might be a better fit to receive mail and distribute it according to some business logic

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!