Still see some dropped header information - drastically less, but not 0.
So I'd say there still might be a race condition or error handling that
isn't right.
I tried to move the outputbuffer handling into ::output, moving any
existing outputbuffer contents to a temporary buffer, killing the
outputbuffer, and dumping that temp buffer first once connected was set,
but I was still getting unparseable relays. Then I pulled the connection
attempt for each line completely letting everything be buffered and just
did the connection attempt after the _eoh was buffered to the
outputbuffer (turning on connected before the Connect call as it was
before - just done after everything was buffered). This also gave
unparseable relays, but in both of these cases at least all received
headers were examined by spamd.
So I'm thinking that the dropped lines are one problem - and either of
the above solutions might help with that - I don't know - but that there
is also a received header formation problem that spamd doesn't like the
result of.
A sample header in the text e-mail might be
Received: from mail02.connect.hpe.com (mail02.connect.hpe.com
[204.92.22.193])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by postoffice-2.autoelect.com (Postfix) with ESMTPS id 9278E9FFB5
for <emailremo...@autoelect.com>; Thu, 15 Jul 2021 09:53:19 -0600 (MDT)
and I see
Received header for spamc: Received: from mail02.connect.hpe.com
(unknown)#015#012#011by postoffice-2.autoelect.com (8.13.0/8.13.0) with
SMTP id unknown#015#012#011Thu, 15 Jul 2021 09:53:19
-0600#015#012#011(envelope-from <bounceb...@connect.hpe.com>);#015
output "Received: from mail02.connect.hpe.com (unknown)#015#012#011by
postoffice-2.autoelect.com (8.13.0/8.13.0) with SMTP id
unknown#015#012#011Thu, 15 Jul 2021 09:53:19
-0600#015#012#011(envelope-from <bounceb...@connect.hpe.com>);#015#012"
output "Received: from P01SNJ404 (10.32.120.245) by
mail02.connect.hpe.com id hu1cus2q38k7 for <emailremo...@autoelect.com>;
Thu, 15 Jul 2021 11:53:18 -0400 (envelope-from
<bounceb...@connect.hpe.com>)#015#012"
from spamass-milter logging and
received-header: unparseable: from mail02.connect.hpe.com (unknown) by
postoffice-2.autoelect.com (8.13.0/8.13.0) with SMTP id unknown Thu, 15
Jul 2021 09:53:19 -0600 (envelope-from <bounceb...@connect.hpe.com>);
received-header: parsed as [ ip=10.32.120.245 rdns=P01SNJ404
helo=P01SNJ404 by=mail02.connect.hpe.com ident=
envfrom=bounceb...@connect.hpe.com intl=0 id=hu1cus2q38k7 auth= msa=0 ]
received-header: relay 10.32.120.245 trusted? yes internal? yes msa? no
from spamd's logging
Thanks, Bill