misc@,

I just discovered that smtpd dies becuase of filter hit "too many open
files".

Last logs from smtpd:

    Jun 11 13:06:03 mx1 smtpd[80363]: 1825a196e20867b3 mta disconnected 
reason=quit messages=1
    Jun 11 13:07:06 mx1 smtpd[80363]: 1825a197ad6634d4 smtp connected 
address=198.2.134.32 host=mail134-32.atl141.mandrillapp.com
    Jun 11 13:07:08 mx1 smtpd[80363]: 1825a197ad6634d4 smtp tls 
ciphers=TLSv1.3:TLS_AES_256_GCM_SHA384:256
    Jun 11 13:07:08 mx1 smtpd[82182]: auth: 1825a197ad6634d4 Can't open 
tempfile: Too many open files
    Jun 11 13:07:08 mx1 smtpd[80363]: dispatcher: tree_xpop(0xfae2ce35960, 
0x1825a197ad6634d4)
    Jun 11 13:07:08 mx1 smtpd[61396]: smtpd: process dispatcher socket closed

inside filter the code which writes that logs looks like:

        if ((msg->origf = tmpfile()) == NULL) {
                auth_err(ctx, "Can't open tempfile");
                return NULL;
        }

..

    void
    auth_err(struct osmtpd_ctx *ctx, char *text)
    {
        struct message *msg = ctx->local_message;

        fprintf(stderr, "%016"PRIx64" %s: %s\n",
                ctx->reqid, text, strerror(errno));

        if (msg != NULL)
            msg->err = 1;
        else
            osmtpd_filter_disconnect(ctx, "Internal server error");
    }

I expect that it clsoes connection, but not kills smtpd.

Am I wrong?

It is running on OpenBSD 7.5

The code of filter is hire: https://github.com/catap/opensmtpd-filter-auth

-- 
wbr, Kirill

Reply via email to