[SOLVED] Customize config template to determine if greylisting is enabled

teward

New Member
Feb 12, 2019
14
0
1
33
Pittsburgh, PA
Hey, all. Just rolled a Proxmox Mail Gateway to replace my Mailborder gateway I've been using (they aren't developing an up-to-date version fast enough before the OS I use for it End of Lifes), and Proxmox gives me about the same functionality with less restrictions for less (FREE in some cases, though I fully intend to get a subscription at some point in the future once sales gets back to me on a few things).

Got one tiny headache which showed up after I disabled Greylisting on this mail gateway. As a result of disabling greylisting, however, the configuration templates by default did NOT disable the 10023 policy checks on the local port regarding greylisting. As a result, mail didn't flow until I manually removed that with the config template.

However, I'd like to utilize a mechanism to only add those config options in if greylisting is actually enabled; so far, I didn't see a way to do that with the configuration template's 'if' checks when ProxMox processes the mail and handles it.

Is there a way to add such an 'optional' configuration directive in the customized config template I"m applying to the Postfix configurations so that I don't have to manually add or remove the greylisting option(s), and can instead have the config generator enable or disable those options if I have greylisting enabled in the config panel?
 
not sure I fully understand your question:
* 10023 is the port where `pmg-smtp-filter` listens for checking the content of the mail, which is (completely) unrelated to the `pmgpolicy` service on port 10022 (this should get disabled in main.cf after you deactivate greylisting _and_ SPF checks in the 'Mail Proxy' Options).
* pmg-smtp-filter runs quite a few checks based on your 'Mail Filter' rule configuration (i.e. it runs mails through SpamAssassin, if you have an outbound rule with a 'Spam' What Object, it runs your configured Antivirus if you have one with a 'Virus' What Object,...)
* Mails get passed through `pmg-smtp-filter` unconditionally so that it can decide dynamically what needs to be done with an outbound mail.

hope that helps!
 
not sure I fully understand your question:
* 10023 is the port where `pmg-smtp-filter` listens for checking the content of the mail, which is (completely) unrelated to the `pmgpolicy` service on port 10022 (this should get disabled in main.cf after you deactivate greylisting _and_ SPF checks in the 'Mail Proxy' Options).
* pmg-smtp-filter runs quite a few checks based on your 'Mail Filter' rule configuration (i.e. it runs mails through SpamAssassin, if you have an outbound rule with a 'Spam' What Object, it runs your configured Antivirus if you have one with a 'Virus' What Object,...)
* Mails get passed through `pmg-smtp-filter` unconditionally so that it can decide dynamically what needs to be done with an outbound mail.

hope that helps!
It helps but it doesn't.

Something about this setup does not like passing to 10023 with the scan: directive even in a default - it simply kept timing out when receiving to itself. I had to comment out that in the template in order to get the thing to behave proper. The original issue was that it was not functioning after the greylisting was disabled, I may have made incorrect assumptions there then about what exactly was at fault

This said, *now* it's running properly, not sure what changed, though I did take a machette to my configs and rebuild the configuration templates I was using.

User error maybe?
 

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!