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

Discussion in 'Mail Gateway: Installation and configuration' started by teward, Feb 12, 2019.

  1. teward

    teward New Member

    Joined:
    Feb 12, 2019
    Messages:
    4
    Likes Received:
    0
    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?
     
  2. Stoiko Ivanov

    Stoiko Ivanov Proxmox Staff Member
    Staff Member

    Joined:
    May 2, 2018
    Messages:
    1,380
    Likes Received:
    129
    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!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. teward

    teward New Member

    Joined:
    Feb 12, 2019
    Messages:
    4
    Likes Received:
    0
    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?
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice