[pfx] Re: [ext] Re: [OT] postfwd3 as check_policy_service hogging the CPU

2024-03-09 Thread Wietse Venema via Postfix-users
Matus UHLAR - fantomas via Postfix-users:
> On 07.03.24 12:14, Wietse Venema via Postfix-users wrote:
> >The Postfix SMTP server counts only the recipients that it accepts,
> >not the ones that it rejects.
> >
> >That is, a DATA or BDAT command after all recipients are rejected
> >will result in a "554 5.5.1 Error: no valid recipients".
> 
> So I guess there is no way for a milter/policy server to know about 
> rejected recipients (other than parsing log file)?
> 
> e.g. the DCC milter would report total count of recipients (including 
> rejected/non-existing) to DCC servers.

Basic principle: Postfix sends only the SMTP commands and message
content that Postfix has not rejected. The exception is the "unknown
command" event in the Milter protocol.

This prevents that Postfix and Milter get out of step, for example
when Postfix rejects something and the Milter accepts it. Both
Postfix and Milters (or the libmilter library) have ideas of what
to expect next, and I control only the Postfix expectations. Changing
this on the Postfix side after almost 20 years is risky. There must
be Milters that have only talked to Postfix.

Wietse
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: [ext] Re: [OT] postfwd3 as check_policy_service hogging the CPU

2024-03-09 Thread Matus UHLAR - fantomas via Postfix-users

On 07.03.24 12:14, Wietse Venema via Postfix-users wrote:

The Postfix SMTP server counts only the recipients that it accepts,
not the ones that it rejects.

That is, a DATA or BDAT command after all recipients are rejected
will result in a "554 5.5.1 Error: no valid recipients".


So I guess there is no way for a milter/policy server to know about 
rejected recipients (other than parsing log file)?



e.g. the DCC milter would report total count of recipients (including 
rejected/non-existing) to DCC servers.


--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Microsoft dick is soft to do no harm
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: [ext] Re: [OT] postfwd3 as check_policy_service hogging the CPU

2024-03-07 Thread Wietse Venema via Postfix-users
Ralf Hildebrandt via Postfix-users:
> * Viktor Dukhovni via Postfix-users :
> 
> > Note that if you want the actual recipient addresses, (not just a
> > count),
> 
> I just need the count in this case
> 
> > you'll need to also intercept recipient restrictions.
> 
> oh!
> 
> > The Postfix smtpd(8) server does not keep the recipient list in memory, the
> > list is streamed out into the queue file (really cleanup service or
> > pre-queue proxy filter).

The Postfix SMTP server counts only the recipients that it accepts,
not the ones that it rejects.

That is, a DATA or BDAT command after all recipients are rejected
will result in a "554 5.5.1 Error: no valid recipients".

Wietse
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: [ext] Re: [OT] postfwd3 as check_policy_service hogging the CPU

2024-03-07 Thread Ralf Hildebrandt via Postfix-users
* Viktor Dukhovni via Postfix-users :

> Note that if you want the actual recipient addresses, (not just a
> count),

I just need the count in this case

> you'll need to also intercept recipient restrictions.

oh!

> The Postfix smtpd(8) server does not keep the recipient list in memory, the
> list is streamed out into the queue file (really cleanup service or
> pre-queue proxy filter).

-- 
Ralf Hildebrandt
  Geschäftsbereich IT | Abteilung Netz | Netzwerk-Administration
  Invalidenstraße 120/121 | D-10115 Berlin
  Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
  ralf.hildebra...@charite.de | https://www.charite.de

___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: [ext] Re: [OT] postfwd3 as check_policy_service hogging the CPU

2024-03-07 Thread Viktor Dukhovni via Postfix-users
On Thu, Mar 07, 2024 at 04:24:56PM +0100, Ralf Hildebrandt via Postfix-users 
wrote:
> * Matus UHLAR - fantomas via Postfix-users :
> 
> > > envelope sender address and number of recipients.
> > 
> > not authenticated user? ;-)
> 
> Yes, I'm also checking if the come from our exchangeserver.
> 
> > if you want to see/process mail size, using it in
> > smtpd_end_of_data_restrictions is necessary.
> > if not, you can use it in smtpd_data_restrictions.
> 
> Then I shall try that instead, since I don't care about the size of
> the mail.
> 
> > However, I'd say the optimal place is where you need it.  Before
> > smtpd_data_restrictions you don't see recipient_count either.
> 
> Yup.

Note that if you want the actual recipient addresses, (not just a
count), you'll need to also intercept recipient restrictions.  The
Postfix smtpd(8) server does not keep the recipient list in memory, the
list is streamed out into the queue file (really cleanup service or
pre-queue proxy filter).

-- 
Viktor.
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: [ext] Re: [OT] postfwd3 as check_policy_service hogging the CPU

2024-03-07 Thread Ralf Hildebrandt via Postfix-users
* Matus UHLAR - fantomas via Postfix-users :

> > envelope sender address and number of recipients.
> 
> not authenticated user? ;-)

Yes, I'm also checking if the come from our exchangeserver.

> if you want to see/process mail size, using it in
> smtpd_end_of_data_restrictions is necessary.
> if not, you can use it in smtpd_data_restrictions.

Then I shall try that instead, since I don't care about the size of
the mail.

> However, I'd say the optimal place is where you need it.  Before
> smtpd_data_restrictions you don't see recipient_count either.

Yup.

-- 
Ralf Hildebrandt
  Geschäftsbereich IT | Abteilung Netz | Netzwerk-Administration
  Invalidenstraße 120/121 | D-10115 Berlin
  Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
  ralf.hildebra...@charite.de | https://www.charite.de

___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org