Correlate relayed mail after the fact

May 20, 2017
174
18
58
Netherlands
cyberfusion.io
Hi,

This question is only slightly PMG-related. I am mostly looking for other users' input.

I use PMG as a smarthost for several purposes, where email sent from a specific domain is sent by a specific system user. Using the mail tracking functionality, I can look up which email was sent from a specific email address or domain. But obviously, even if domain A administratively belongs to system user A, system user B can send mail from it. And I want to ignore those emails when user A requests logs.

My idea: add an `X-UID` header before relaying to Proxmox, so that I can correlate the sending system user after the fact - allowing me to exclude mails sent from a specific domain, but by a different system user than the one we want.

However... the `/nodes/{node}/tracker` endpoint doesn't allow me to filter on headers. There is an `xfilter` parameter that filters on a string, but a loose match is inefficient for this purpose. And it doesn't even allow me to search headers, because Postfix doesn't keep track of those in its logs, and `pmg-log-tracker` just reads those.

How do other users, using PMG as a smarthost, approach this?

On an unrelated note, it doesn't seem like one can search through the tracker cluster-wide (I see it reads logs from local disk). Are there plans to natively support a cluster-wide tracker? Looping through all cluster nodes and doing the API call N amount of times is inefficient. I did find https://forum.proxmox.com/threads/aggregate-tracking-center-logs-of-multiple-nodes-into-one.136063/, but I'm not going to hack together something unsupported.
 
Last edited:

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!