Re: policy_service protocol_state with smtpd_delay_reject

2021-07-13 Thread Viktor Dukhovni
On Fri, Jul 09, 2021 at 02:07:02AM +0300, Kevin N. wrote: > > Is there a way to reuse the same instance of the script, not spawn two > > instances, and some how have the script know which restriction it was > > called from? > > Not sure if this helps, but maybe you could try to implement your p

Re: policy_service protocol_state with smtpd_delay_reject

2021-07-08 Thread Kevin N.
Is there a way to reuse the same instance of the script, not spawn two instances, and some how have the script know which restriction it was called from? Not sure if this helps, but maybe you could try to implement your policy server as a standalone network server instead of calling it through

Re: policy_service protocol_state with smtpd_delay_reject

2021-07-08 Thread postfix
On 07-08-2021 5:27 pm, Kevin N. wrote: Haven't tried it, but this might be what you are looking for. http://www.postfix.org/SMTPD_POLICY_README.html#advanced check_policy_service { inet:host:port, timeout=10s, default_action=DUNNO policy_context=submission }

Re: policy_service protocol_state with smtpd_delay_reject

2021-07-08 Thread Kevin N.
I was curious so I did a quick test :) . As suspected, it does work. Having a setup like: smtpd_delay_reject = yes smtpd_helo_required = yes smtpd_helo_restrictions = ... check_policy_service { unix:private/policy-service, policy_context=helo_restrictions_value } ... smtpd_r

Re: policy_service protocol_state with smtpd_delay_reject

2021-07-08 Thread Viktor Dukhovni
On Thu, Jul 08, 2021 at 05:53:37PM -0400, post...@ptld.com wrote: > > This problem report is not consistent with the Postfix source code, > > which reports the correct protocol state. Perhaps you don't actually > > have "smtpd_delay_reject = no" in place. Sorry, I misread your question, thought

Re: policy_service protocol_state with smtpd_delay_reject

2021-07-08 Thread postfix
On 07-08-2021 5:39 pm, Viktor Dukhovni wrote: On Thu, Jul 08, 2021 at 04:49:03PM -0400, post...@ptld.com wrote: I notice when using SMTPD_DELAY_REJECT=yes and calling a CHECK_POLICY_SERVICE inside SMTPD_HELO_RESTRICTIONS it will report "protocol_state = RCPT", same as when you call the policy ser

Re: policy_service protocol_state with smtpd_delay_reject

2021-07-08 Thread Viktor Dukhovni
On Thu, Jul 08, 2021 at 04:49:03PM -0400, post...@ptld.com wrote: > I notice when using SMTPD_DELAY_REJECT=yes and calling a > CHECK_POLICY_SERVICE inside SMTPD_HELO_RESTRICTIONS it will report > "protocol_state = RCPT", same as when you call the policy service from > inside SMTPD_RECIPIENT_REST

Re: policy_service protocol_state with smtpd_delay_reject

2021-07-08 Thread Kevin N.
Haven't tried it, but this might be what you are looking for. http://www.postfix.org/SMTPD_POLICY_README.html#advanced check_policy_service { inet:host:port, timeout=10s, default_action=DUNNO policy_context=submission } ... From the SMTPD_POLICY_README: T

policy_service protocol_state with smtpd_delay_reject

2021-07-08 Thread postfix
I notice when using SMTPD_DELAY_REJECT=yes and calling a CHECK_POLICY_SERVICE inside SMTPD_HELO_RESTRICTIONS it will report "protocol_state = RCPT", same as when you call the policy service from inside SMTPD_RECIPIENT_RESTRICTIONS. Is there a way to pass a value from the CHECK_POLICY_SERVICE l