Re: Policy Server Development

2021-04-17 Thread Fred Morris
On Fri, 16 Apr 2021, post...@ptld.com wrote: On 04-16-2021 1:04 pm, Wietse Venema wrote: As Viktor noted, each smtpd(8) process makes its own connection to a policy service. Then, an smtpd(8) process will reuse its own policy service connection, not a connection that belongs to a different

Re: Policy Server Development

2021-04-16 Thread Wietse Venema
post...@ptld.com: > On 04-16-2021 1:04 pm, Wietse Venema wrote: > > As Viktor noted, each smtpd(8) process makes its own connection to > > a policy service. Then, an smtpd(8) process will reuse its own > > policy service connection, not a connection that belongs to a > > different smtpd(8) process.

Re: Policy Server Development

2021-04-16 Thread postfix
On 04-16-2021 1:28 pm, Viktor Dukhovni wrote: Of course. Since it is spawned for a single connection, once that connection is closed, it couldn't possibly get any further requests. This is not the same as handling one request, you still need a loop to handle one or requests until EOF. I will

Re: Policy Server Development

2021-04-16 Thread Viktor Dukhovni
On Fri, Apr 16, 2021 at 01:22:25PM -0400, post...@ptld.com wrote: > On 04-16-2021 1:04 pm, Wietse Venema wrote: > > As Viktor noted, each smtpd(8) process makes its own connection to > > a policy service. Then, an smtpd(8) process will reuse its own > > policy service connection, not a connection

Re: Policy Server Development

2021-04-16 Thread postfix
On 04-16-2021 1:04 pm, Wietse Venema wrote: As Viktor noted, each smtpd(8) process makes its own connection to a policy service. Then, an smtpd(8) process will reuse its own policy service connection, not a connection that belongs to a different smtpd(8) process. Okay, if im understanding, the

Re: Policy Server Development

2021-04-16 Thread postfix
On 04-16-2021 1:04 pm, Wietse Venema wrote: What evidence do you have that you have zombie processes, and not simply processes that are idle waiting for work? Wietse Watching ps, for each incoming email a new spfpolicy and userpolicy gets spawned. After a few minutes each spfpolicy t

Re: Policy Server Development

2021-04-16 Thread postfix
On 04-16-2021 12:43 pm, Viktor Dukhovni wrote: On Fri, Apr 16, 2021 at 11:50:12AM -0400, post...@ptld.com wrote: master.cf: userpolicy unix - n n - 0 spawn user=mail argv=/usr/libexec/postfix/per-user-policy This means one process per connection. So when there are multiple smtpd(8) proce

Re: Policy Server Development

2021-04-16 Thread Wietse Venema
post...@ptld.com: > There are no errors or warnings. The script runs and works. I can see > the values (request=smtpd_access_policy, etc) saved by the script to > log. I can also run the script from console with no errors or warnings. > Everything works, only problem is script never ends and bec

Re: Policy Server Development

2021-04-16 Thread postfix
There are no errors or warnings. The script runs and works. I can see the values (request=smtpd_access_policy, etc) saved by the script to log. I can also run the script from console with no errors or warnings. Everything works, only problem is script never ends and becomes zombie. What should

Re: Policy Server Development

2021-04-16 Thread Viktor Dukhovni
On Fri, Apr 16, 2021 at 11:50:12AM -0400, post...@ptld.com wrote: > master.cf: >userpolicy unix - n n - 0 spawn user=mail > argv=/usr/libexec/postfix/per-user-policy This means one process per connection. So when there are multiple smtpd(8) processes, each one will spawn a separate policy s

Re: Policy Server Development

2021-04-16 Thread Wietse Venema
post...@ptld.com: > As of now the policy script writes values supplied by postfix to a log > file and returns the expected action=dunno and empty line. I designed > the PHP to run in a loop with no time outs for it to be available for > multiple request. My understanding of SMTPD_POLICY_README i

Policy Server Development

2021-04-16 Thread postfix
I am writing a policy server in PHP. I am confused by some of postfix behavior. I designed the PHP service in this manner; /usr/libexec/postfix/per-user-policy: #!/usr/bin/php master.cf: userpolicy unix - n n - 0 spawn user=mail argv=/usr/libexec/postfix/per-user-policy main.cf: userpoli