On Sat, 5 Jun 2021, Claus Assmann wrote:
Maybe someone else understands the problem because I don't.
I guess I haven't explained it very well. Let me try again.
I have two milters. One is big (huge) but fast, the other is small
but it can be very slow. Often, the small one holds up the big one so
that the big one consumes a lot of resources while doing *nothing* but
wait for the MTA to release it from duty. That can be a nuisance, it
can hold up the flow of mail because there's no milter child process
available for Sendmail to connect to when a new connection comes in.
All the existing child processes are busy, some of them doing nothing.
! Ideally, I should like to be able to tell Sendmail to call the close
! callback for the first milter when the first milter knows it's done
Why does it make a difference between sendmail "call[ing] the close
callback" and your own milter doing that?
Until I read your question above, I had the impression that callbacks
are for the MTA to call. It never occurred to me to call them myself
and I'd have expected doing that to break the communications between
Sendmail and the milter. Does Sendmail not care if I call the close
callback myself? If it's allowed by the milter protocol, then the
problem might be solved. :) Granted I haven't read that it isn't, I
guess I just ass-u-me-d it isn't. I'll experiment with the idea.
If your "milter returns 'SMFIS_ACCEPT' from the connect callback"
then why would it even allocate resources which it doesn't need?
As I said, some of the state is persistent and it allocates quite a
variety of resources, some of which it allocates at 'connect' in the expectation of using it both there and in later callbacks. When it deallocates, it has to choose what it frees (garbage collection) and
when it frees it. On top of all this it's written in Perl so before
it even allocates any storage the thing starts off pretty big anyway
and there's not a lot I can do about that - short of rewriting parts
of it in C, which is on the cards when some of my outlandish theory
is either justified or proved not to be useful. It generally looks
like I'm on the right track, at least other people seem to see much
more spam and malicious stuff in their INBOX than I do.
If your milter returns SMFIS_ACCEPT from a transaction callback
then sendmail has no way to know that your milter doesn't even want
the subsequent transactions, i.e., you would have to come up with
another return code.
Hmmm, that doesn't sound so good for my situation and it's not what
I've taken home from the docs. The milter docs state as follows:
[quote source=file:///.../sendmail-8.17.0.0/libmilter/docs/api.html]
SMFIS_ACCEPT
For a connection-oriented routine, accept this connection without
further filter processing; ***CALL XXFI_CLOSE***. <=== my ephasis.
For a message- or recipient-oriented routine, accept this message
without further filtering.
[/quote]
There it says "call xxfi_close", which at first I took to mean that
the MTA would call xxfi_close immediately. Unfortunately it doesn't
call the callback until after completing all other milter processing
which is why I'm in this, er, bind. My naive thought processes ran
along the lines of
"If the milter replies SMFIS_ACCEPT, then that must tell Sendmail that
the only subsequent transaction will be close (or perhaps abort)".
Is that wrong? If so, why?
Anway, you got the source, so you can hack it to do what you
consider necessary for your special situation.
Quite so. Thanks again for your help, and for your dedication in the
face of all the stupid questions.
Ged.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)