On Tue, 11 Jun 2024 23:10:07 +0100,
Kirill A. Korinsky <kir...@korins.ky> wrote:
> 
> I register session / message related things like this:
> 
>       osmtpd_local_session(auth_session_new, auth_session_free);
>       osmtpd_local_message(auth_message_new, auth_message_free);
> 
> and I made an assumtion that both free method are called when I call:
> 
>     osmtpd_filter_disconnect(ctx, "Internal server error");
> 
> am I right with that assumtion?
> 

Seems that I was wrong. Or at least it hasn't happened each connection.

It defently may missbehave on error, and to avoid complexity of code I
migrated filter to osmtpd_err/osmtpd_errx in case of error which exists a
filter if syscall returns something unexcpected.

Also, I've added trace log each time when auth_{message,session}_{new,free}
is called, as first statment of the function.

And for the last night I had 14 leaked files. All of them had happened from
incomming connections from mail.nginx.org, and usuall log associeted with
connection looks like:

    mx1$ grep 78ba6f2a7dceb938 /var/log/maillog                                 
                                                                               
    Jun 13 05:55:11 mx1 smtpd[97991]: 78ba6f2a7dceb938 smtp connected 
address=206.251.255.65 host=mail.nginx.com
    Jun 13 05:55:11 mx1 smtpd[84725]: auth: 78ba6f2a7dceb938 session_new
    Jun 13 05:55:13 mx1 smtpd[97991]: 78ba6f2a7dceb938 smtp tls 
ciphers=TLSv1.3:TLS_AES_256_GCM_SHA384:256
    Jun 13 05:55:14 mx1 smtpd[84725]: auth: 78ba6f2a7dceb938 message_new
    mx1$ 

No dissconnect, no call auth_{message,session}_free, nothing.

-- 
wbr, Kirill

Reply via email to