header_checks & mail routing

Aug 5, 2020
8
0
6
123
Hello everyone.

Please forgive me if this has been answered elsewhere ... I searched and couldn't find anything I could use.

So I have a situation like this:
Who objects comprised of PRINTERS
I would like the traffic from these PRINTERS to follow another path out of the gateway.

There's an incoming rule that accepts the mail from PRINTERS and then, have an outgoing rule that adds a header to emails from these PRINTERS in the form: X-Printer-IP-Addy
I could then use header_checks with the following entry:
/^X-Printer-IP-Addy: (.*)$/ FILTER smtp:mailtarget.company.com

Unfortunately, this doesn't seem to be working. Any help would be greatly appreciated.

Thanks.
 
I did it by changing the master.cf configuration file via the template master.cf, copying that over from /var/lib/pmg/templates.
I also set up the header_checks by changing the main.cf template file as well.
I saw that in the template master.cf, there was a no_body_header_checks option and I disabled that.

The question is, if one were trying to implement what I wanted, how would one go about doing that, if not the way I did?

Thanks again.
 
The question is, if one were trying to implement what I wanted, how would one go about doing that, if not the way I did?
from https://serverfault.com/questions/6...d-on-from-mail-header-rather-than-envelope-se and https://marcelog.github.io/articles...ward_email_regex_subject_transport_relay.html the config should potentially work

do the printers send with a specific sender address? - then maybe you could use the ` sender_dependent_relayhost_maps` postfix config option

You could get some more infos by enabling the -v option on the outbound smtpd process (the one on port 10025) - see http://www.postfix.org/DEBUG_README.html

I hope this helps!
 
No, the printers will not be sending with any specific address.
After changing the template files (and?) the actual *.cf files, all I'd have to do is restart the postfix services, yes?
From the manual, I'm given to understand that postfix will synchronize the template files between the nodes. Must the files already exist on the secondary node beforehand?
 
After changing the template files (and?) the actual *.cf files, all I'd have to do is restart the postfix services, yes?
you adapt the templates, run pmgconfig sync to render the config-files - verify the change in the actual config-files and restart postfix.

From the manual, I'm given to understand that postfix will synchronize the template files between the nodes. Must the files already exist on the secondary node beforehand?
PMG's cluster-stack syncs the config-files across the cluster and renders the config - however this is not instantaneous, but rather happens in regular intervals - run pmgcm sync - and verify the config on the node

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!